diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs deleted file mode 100644 index d619718162b9..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs +++ /dev/null @@ -1,6630 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.AI.Language.Conversations.Authoring.Models; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.AI.Language.Conversations.Authoring -{ - // Data plane generated sub-client. - /// The AnalyzeConversationAuthoring sub-client. - public partial class AnalyzeConversationAuthoring - { - private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; - private readonly AzureKeyCredential _keyCredential; - private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; - private readonly TokenCredential _tokenCredential; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - 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 AnalyzeConversationAuthoring for mocking. - protected AnalyzeConversationAuthoring() - { - } - - /// Initializes a new instance of AnalyzeConversationAuthoring. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The key credential to copy. - /// The token credential to copy. - /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. - /// The API version to use for this operation. - internal AnalyzeConversationAuthoring(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) - { - ClientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - _keyCredential = keyCredential; - _tokenCredential = tokenCredential; - _endpoint = endpoint; - _apiVersion = apiVersion; - } - - /// Gets the details of a project. - /// The new project name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); - return Response.FromValue(ProjectMetadata.FromResponse(response), response); - } - - /// Gets the details of a project. - /// The new project name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetProject(projectName, context); - return Response.FromValue(ProjectMetadata.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetProjectAsync(string projectName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProject"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectRequest(projectName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetProject(string projectName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProject"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectRequest(projectName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new project or updates an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new project or updates an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Generates a copy project operation authorization to the current target Azure resource. - /// The new project name. - /// Represents the project kind. - /// The name of the storage container. - /// Whether to allow an existing project to be overwritten using the resulting copy authorization. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CopyProjectAuthorizationAsync(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CopyProjectAuthorizationAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(CopyProjectDetails.FromResponse(response), response); - } - - /// Generates a copy project operation authorization to the current target Azure resource. - /// The new project name. - /// Represents the project kind. - /// The name of the storage container. - /// Whether to allow an existing project to be overwritten using the resulting copy authorization. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CopyProjectAuthorization(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = CopyProjectAuthorization(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); - return Response.FromValue(CopyProjectDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CopyProjectAuthorizationAsync(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProjectAuthorization"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CopyProjectAuthorization(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProjectAuthorization"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing copy project job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(CopyProjectJobState.FromResponse(response), response); - } - - /// Gets the status of an existing copy project job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetCopyProjectStatus(projectName, jobId, context); - return Response.FromValue(CopyProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing copy project job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetCopyProjectStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing copy project job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetCopyProjectStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetCopyProjectStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of a deployment. - /// The new project name. - /// Represents deployment name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); - return Response.FromValue(ProjectDeployment.FromResponse(response), response); - } - - /// Gets the details of a deployment. - /// The new project name. - /// Represents deployment name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeployment(projectName, deploymentName, context); - return Response.FromValue(ProjectDeployment.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeployment(string projectName, string deploymentName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing delete deployment from specific resources job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing delete deployment from specific resources job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); - return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentDeleteFromResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentDeleteFromResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing deployment job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentJobState.FromResponse(response), response); - } - - /// Gets the status of an existing deployment job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); - return Response.FromValue(DeploymentJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing swap deployment job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); - } - - /// Gets the status of an existing swap deployment job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSwapDeploymentsStatus(projectName, jobId, context); - return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing swap deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSwapDeploymentsStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing swap deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSwapDeploymentsStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, 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 new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ExportProjectJobState.FromResponse(response), response); - } - - /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportStatus(projectName, jobId, context); - return Response.FromValue(ExportProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an import. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ImportProjectJobState.FromResponse(response), response); - } - - /// Gets the status for an import. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetImportStatus(projectName, jobId, context); - return Response.FromValue(ImportProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an import. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetImportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an import. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetImportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of a trained model. - /// The new project name. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); - return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); - } - - /// Gets the details of a trained model. - /// The new project name. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTrainedModel(projectName, trainedModelLabel, context); - return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an evaluation job. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); - return Response.FromValue(EvaluationJobState.FromResponse(response), response); - } - - /// Gets the status for an evaluation job. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); - return Response.FromValue(EvaluationJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an evaluation job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetEvaluationStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an evaluation job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetEvaluationStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// The name of the project to use. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); - return Response.FromValue(EvaluationSummary.FromResponse(response), response); - } - - /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// The name of the project to use. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); - return Response.FromValue(EvaluationSummary.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetModelEvaluationSummary"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetModelEvaluationSummary"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for loading a snapshot. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); - return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); - } - - /// Gets the status for loading a snapshot. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); - return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for loading a snapshot. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetLoadSnapshotStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for loading a snapshot. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetLoadSnapshotStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing assign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing assign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); - return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing assign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing assign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing unassign deployment resources job. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing unassign deployment resources job. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); - return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing unassign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetUnassignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing unassign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetUnassignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for a training job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(TrainingJobState.FromResponse(response), response); - } - - /// Gets the status for a training job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTrainingStatus(projectName, jobId, context); - return Response.FromValue(TrainingJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for a training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for a training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetTrainingStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for a project deletion job. - /// The job ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); - return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); - } - - /// Gets the status for a project deletion job. - /// The job ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetProjectDeletionStatus(jobId, context); - return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for a project deletion job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetProjectDeletionStatusAsync(string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProjectDeletionStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for a project deletion job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetProjectDeletionStatus(string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProjectDeletionStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// 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 cancellation token to use. - /// - public virtual async Task> GetAssignedResourceDeploymentsAsync(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAssignedResourceDeploymentsAsync(top, skip, maxpagesize, context).ConfigureAwait(false); - return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); - } - - /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// 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 cancellation token to use. - /// - public virtual Response GetAssignedResourceDeployments(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAssignedResourceDeployments(top, skip, maxpagesize, context); - return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); - } - - /// - /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The 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 of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetAssignedResourceDeploymentsAsync(int? top, int? skip, int? maxpagesize, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignedResourceDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The 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 of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetAssignedResourceDeployments(int? top, int? skip, int? maxpagesize, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignedResourceDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the supported languages for the given project type. - /// The project kind. - /// 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 cancellation token to use. - /// - public virtual async Task> GetSupportedLanguagesAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSupportedLanguagesAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); - return Response.FromValue(SupportedLanguages.FromResponse(response), response); - } - - /// Lists the supported languages for the given project type. - /// The project kind. - /// 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 cancellation token to use. - /// - public virtual Response GetSupportedLanguages(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSupportedLanguages(projectKind.ToString(), top, skip, maxpagesize, context); - return Response.FromValue(SupportedLanguages.FromResponse(response), response); - } - - /// - /// [Protocol Method] Lists the supported languages for the given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". - /// 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 of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetSupportedLanguagesAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNull(projectKind, nameof(projectKind)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedLanguages"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Lists the supported languages for the given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". - /// 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 of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetSupportedLanguages(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNull(projectKind, nameof(projectKind)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedLanguages"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the supported prebuilt entities that can be used while creating composed entities. - /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// 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 cancellation token to use. - /// - public virtual async Task> GetSupportedPrebuiltEntitiesAsync(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSupportedPrebuiltEntitiesAsync(language, multilingual, top, skip, maxpagesize, context).ConfigureAwait(false); - return Response.FromValue(PrebuiltEntities.FromResponse(response), response); - } - - /// Lists the supported prebuilt entities that can be used while creating composed entities. - /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// 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 cancellation token to use. - /// - public virtual Response GetSupportedPrebuiltEntities(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSupportedPrebuiltEntities(language, multilingual, top, skip, maxpagesize, context); - return Response.FromValue(PrebuiltEntities.FromResponse(response), response); - } - - /// - /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// 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 of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetSupportedPrebuiltEntitiesAsync(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedPrebuiltEntities"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. - /// 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 of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetSupportedPrebuiltEntities(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) - { - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedPrebuiltEntities"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the support training config version for a given project type. - /// The project kind. - /// 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 cancellation token to use. - /// - public virtual async Task> GetTrainingConfigVersionsAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTrainingConfigVersionsAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); - return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); - } - - /// Lists the support training config version for a given project type. - /// The project kind. - /// 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 cancellation token to use. - /// - public virtual Response GetTrainingConfigVersions(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTrainingConfigVersions(projectKind.ToString(), top, skip, maxpagesize, context); - return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); - } - - /// - /// [Protocol Method] Lists the support training config version for a given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". - /// 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 of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetTrainingConfigVersionsAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNull(projectKind, nameof(projectKind)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingConfigVersions"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Lists the support training config version for a given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". - /// 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 of the client pipeline on a per-call basis. - /// is null. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetTrainingConfigVersions(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNull(projectKind, nameof(projectKind)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingConfigVersions"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of an exported model. - /// The new project name. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); - return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); - } - - /// Gets the details of an exported model. - /// The new project name. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportedModel(projectName, exportedModelName, context); - return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportedModel(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an existing job to create or update an exported model. - /// The new project name. - /// The exported model name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ExportedModelJobState.FromResponse(response), response); - } - - /// Gets the status for an existing job to create or update an exported model. - /// The new project name. - /// The exported model name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); - return Response.FromValue(ExportedModelJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an existing job to create or update an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModelJobStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an existing job to create or update an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModelJobStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the existing projects. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// Lists the existing projects. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the existing projects. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the existing projects. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the trained models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// Lists the trained models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the trained models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the trained models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments resources assigned to the project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments resources assigned to the project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments resources assigned to the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments resources assigned to the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// Lists the non-expired training jobs created for a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// Lists the non-expired training jobs created for a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the non-expired training jobs created for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the non-expired training jobs created for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// Lists the exported models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// Lists the exported models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the exported models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the exported models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Copies an existing project to another Azure resource. - /// 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. - /// The name of the project to use. - /// The copy project info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Copies an existing project to another Azure resource. - /// 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. - /// The name of the project to use. - /// The copy project info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return CopyProject(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Copies an existing project to another Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Copies an existing project to another Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a job to export a project's data. - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The format of the exported project file to use. - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, ExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); - } - - /// Triggers a job to export a project's data. - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The format of the exported project file to use. - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, ExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - return Export(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context); - } - - /// - /// [Protocol Method] Triggers a job to export a project's data. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Export"); - scope.Start(); - try - { - using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to export a project's data. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Export(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Export"); - scope.Start(); - try - { - using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// 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. - /// The name of the project to use. - /// The project data to import. - /// The format of the exported project file to use. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject body, ExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await ImportAsync(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context).ConfigureAwait(false); - } - - /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// 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. - /// The name of the project to use. - /// The project data to import. - /// The format of the exported project file to use. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject body, ExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return Import(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context); - } - - /// - /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Import"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Import"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a training job for a project. - /// 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. - /// The name of the project to use. - /// The training input parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.Train"); - } - - /// Triggers a training job for a project. - /// 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. - /// The name of the project to use. - /// The training input parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = Train(waitUntil, projectName, content, context); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.Train"); - } - - /// - /// [Protocol Method] Triggers a training job for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Train"); - scope.Start(); - try - { - using HttpMessage message = CreateTrainRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a training job for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Train"); - scope.Start(); - try - { - using HttpMessage message = CreateTrainRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Swaps two existing deployments with each other. - /// 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. - /// The name of the project to use. - /// The job object to swap two deployments. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Swaps two existing deployments with each other. - /// 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. - /// The name of the project to use. - /// The job object to swap two deployments. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return SwapDeployments(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Swaps two existing deployments with each other. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.SwapDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Swaps two existing deployments with each other. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.SwapDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Creates a new deployment or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The new deployment info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); - } - - /// Creates a new deployment or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The new deployment info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return DeployProject(waitUntil, projectName, deploymentName, content, context); - } - - /// - /// [Protocol Method] Creates a new deployment or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeployProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new deployment or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeployProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Deletes a project deployment from the specified assigned resources. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The options for deleting the deployment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); - } - - /// Deletes a project deployment from the specified assigned resources. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The options for deleting the deployment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); - } - - /// - /// [Protocol Method] Deletes a project deployment from the specified assigned resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeploymentFromResources"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Deletes a project deployment from the specified assigned resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeploymentFromResources"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers evaluation operation on a trained model. - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The training input parameters. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel"); - } - - /// Triggers evaluation operation on a trained model. - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The training input parameters. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); - return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel"); - } - - /// - /// [Protocol Method] Triggers evaluation operation on a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.EvaluateModel"); - scope.Start(); - try - { - using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers evaluation operation on a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.EvaluateModel"); - scope.Start(); - try - { - using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Restores the snapshot of this trained model to be the current working directory of the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.LoadSnapshot"); - scope.Start(); - try - { - using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Restores the snapshot of this trained model to be the current working directory of the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.LoadSnapshot"); - scope.Start(); - try - { - using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. - /// 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. - /// The name of the project to use. - /// The new project resources info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. - /// 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. - /// The name of the project to use. - /// The new project resources info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return AssignDeploymentResources(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.AssignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.AssignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// 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. - /// The name of the project to use. - /// The info for the deployment resources to be deleted. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// 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. - /// The name of the project to use. - /// The info for the deployment resources to be deleted. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return UnassignDeploymentResources(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.UnassignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.UnassignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a cancellation for a running training 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. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob"); - } - - /// Triggers a cancellation for a running training 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. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob"); - } - - /// - /// [Protocol Method] Triggers a cancellation for a running training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CancelTrainingJob"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a cancellation for a running training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CancelTrainingJob"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Creates a new exported model or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The exported model info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); - } - - /// Creates a new exported model or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The exported model info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); - } - - /// - /// [Protocol Method] Creates a new exported model or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateOrUpdateExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new exported model or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateOrUpdateExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetProjectRequest(string projectName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200201); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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/merge-patch+json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCopyProjectAuthorizationRequest(string projectName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:authorize-copy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateCopyProjectRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:copy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateExportRequest(string projectName, string stringIndexType, string exportedProjectFormat, string assetKind, string trainedModelLabel, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:export", false); - uri.AppendQuery("stringIndexType", stringIndexType, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (exportedProjectFormat != null) - { - uri.AppendQuery("format", exportedProjectFormat, true); - } - if (assetKind != null) - { - uri.AppendQuery("assetKind", assetKind, true); - } - if (trainedModelLabel != null) - { - uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string exportedProjectFormat, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:import", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (exportedProjectFormat != null) - { - uri.AppendQuery("format", exportedProjectFormat, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:train", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetCopyProjectStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/copy/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateSwapDeploymentsRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/:swap", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - return message; - } - - internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - return message; - } - - internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/:delete-from-resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/delete-from-resources/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - return message; - } - - internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/swap/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - return message; - } - - internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/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"); - return message; - } - - internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/:evaluate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/:load-snapshot", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluate/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluation/result", false); - uri.AppendQuery("stringIndexType", stringIndexType, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluation/summary-result", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/load-snapshot/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/:assign", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateUnassignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/:unassign", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/assign/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/unassign/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/jobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string 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("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/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; - } - - internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/global/deletion-jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? top, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/global/deployments/resources", 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"); - return message; - } - - internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/global/languages", false); - uri.AppendQuery("projectKind", projectKind, true); - 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"); - return message; - } - - internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/global/prebuilt-entities", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (language != null) - { - uri.AppendQuery("language", language, true); - } - if (multilingual != null) - { - uri.AppendQuery("multilingual", multilingual, 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"); - return message; - } - - internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? top, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/global/training-config-versions", false); - uri.AppendQuery("projectKind", projectKind, true); - 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"); - return message; - } - - internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-conversations/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - private static RequestContext DefaultRequestContext = new RequestContext(); - internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) - { - if (!cancellationToken.CanBeCanceled) - { - return DefaultRequestContext; - } - - return new RequestContext() { CancellationToken = cancellationToken }; - } - - private static ResponseClassifier _responseClassifier200; - private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); - private static ResponseClassifier _responseClassifier200201; - private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); - private static ResponseClassifier _responseClassifier202; - private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - private static ResponseClassifier _responseClassifier204; - private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); - - private TrainingJobResult FetchTrainingJobResultFromTrainingJobState(Response response) - { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); - return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); - } - - private EvaluationJobResult FetchEvaluationJobResultFromEvaluationJobState(Response response) - { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); - return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs index 9b8fcdf03b96..06174a6ef5e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs @@ -6,13 +6,16 @@ #nullable disable using System; +using System.Threading; +using Autorest.CSharp.Core; +using Azure.AI.Language.Conversations.Authoring.Models; using Azure.Core; using Azure.Core.Pipeline; namespace Azure.AI.Language.Conversations.Authoring { // Data plane generated client. - /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. + /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. public partial class AuthoringClient { private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; @@ -21,6 +24,7 @@ public partial class AuthoringClient private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; + private readonly string _apiVersion; /// The ClientDiagnostics is used to provide tracing support for the client library. internal ClientDiagnostics ClientDiagnostics { get; } @@ -64,6 +68,7 @@ public AuthoringClient(Uri endpoint, AzureKeyCredential credential, AuthoringCli _keyCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); _endpoint = endpoint; + _apiVersion = options.Version; } /// Initializes a new instance of AuthoringClient. @@ -81,16 +86,1421 @@ public AuthoringClient(Uri endpoint, TokenCredential credential, AuthoringClient _tokenCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); _endpoint = endpoint; + _apiVersion = options.Version; } - /// Initializes a new instance of AnalyzeConversationAuthoring. - /// The API version to use for this operation. - /// is null. - public virtual AnalyzeConversationAuthoring GetAnalyzeConversationAuthoringClient(string apiVersion = "2024-11-15-preview") + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return new AnalyzeConversationAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetSupportedLanguagesAsync(AnalyzeConversationAuthoringProjectKind projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetSupportedLanguages(AnalyzeConversationAuthoringProjectKind projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the supported languages for the given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the supported languages for the given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetSupportedLanguages(string projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetAssignedResourceDeployments(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The cancellation token to use. + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string language = null, string multilingual = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(maxCount, skip, pageSizeHint, language, multilingual, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, maxCount, skip, pageSizeHint, language, multilingual, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The cancellation token to use. + public virtual Pageable GetSupportedPrebuiltEntities(int? maxCount = null, int? skip = null, int? maxpagesize = null, string language = null, string multilingual = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(maxCount, skip, pageSizeHint, language, multilingual, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, maxCount, skip, pageSizeHint, language, multilingual, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(int? maxCount, int? skip, int? maxpagesize, string language, string multilingual, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(maxCount, skip, pageSizeHint, language, multilingual, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, maxCount, skip, pageSizeHint, language, multilingual, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetSupportedPrebuiltEntities(int? maxCount, int? skip, int? maxpagesize, string language, string multilingual, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(maxCount, skip, pageSizeHint, language, multilingual, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, maxCount, skip, pageSizeHint, language, multilingual, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", maxpagesize, context); + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetTrainingConfigVersionsAsync(AnalyzeConversationAuthoringProjectKind projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetTrainingConfigVersions(AnalyzeConversationAuthoringProjectKind projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainingConfigVersions(string projectKind, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingOperationState.DeserializeTrainingOperationState(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingOperationState.DeserializeTrainingOperationState(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + private ConversationAuthoringDeployments _cachedConversationAuthoringDeployments; + private ConversationAuthoringProjects _cachedConversationAuthoringProjects; + private ConversationAuthoringModels _cachedConversationAuthoringModels; + + /// Initializes a new instance of ConversationAuthoringDeployments. + public virtual ConversationAuthoringDeployments GetConversationAuthoringDeploymentsClient() + { + return Volatile.Read(ref _cachedConversationAuthoringDeployments) ?? Interlocked.CompareExchange(ref _cachedConversationAuthoringDeployments, new ConversationAuthoringDeployments(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedConversationAuthoringDeployments; + } + + /// Initializes a new instance of ConversationAuthoringProjects. + public virtual ConversationAuthoringProjects GetConversationAuthoringProjectsClient() + { + return Volatile.Read(ref _cachedConversationAuthoringProjects) ?? Interlocked.CompareExchange(ref _cachedConversationAuthoringProjects, new ConversationAuthoringProjects(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedConversationAuthoringProjects; + } + + /// Initializes a new instance of ConversationAuthoringModels. + public virtual ConversationAuthoringModels GetConversationAuthoringModelsClient() + { + return Volatile.Read(ref _cachedConversationAuthoringModels) ?? Interlocked.CompareExchange(ref _cachedConversationAuthoringModels, new ConversationAuthoringModels(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedConversationAuthoringModels; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/languages", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(int? maxCount, int? skip, int? maxpagesize, string language, string multilingual, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (language != null) + { + uri.AppendQuery("language", language, true); + } + if (multilingual != null) + { + uri.AppendQuery("multilingual", multilingual, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/training-config-versions", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string language, string multilingual, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + 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"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringDeployments.cs new file mode 100644 index 000000000000..3ecbf992129c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringDeployments.cs @@ -0,0 +1,1683 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations.Authoring +{ + // Data plane generated sub-client. + /// The ConversationAuthoringDeployments sub-client. + public partial class ConversationAuthoringDeployments + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 ConversationAuthoringDeployments for mocking. + protected ConversationAuthoringDeployments() + { + } + + /// Initializes a new instance of ConversationAuthoringDeployments. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal ConversationAuthoringDeployments(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeployment(projectName, deploymentName, context); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeployment(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentDeleteFromResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentDeleteFromResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(SwapDeploymentsOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSwapDeploymentsStatus(projectName, jobId, context); + return Response.FromValue(SwapDeploymentsOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(DeploymentResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing unassign deployment resources job. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing unassign deployment resources job. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(DeploymentResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Swaps two existing deployments with each other. + /// 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. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Swaps two existing deployments with each other. + /// 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. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return SwapDeployments(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new deployment or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Creates a new deployment or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeployProject(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return AssignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return UnassignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringDeployments.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringDeployments.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateSwapDeploymentsRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/:swap", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/:delete-from-resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/delete-from-resources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + return message; + } + + internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/swap/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:assign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUnassignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:unassign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/assign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/unassign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringModels.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringModels.cs new file mode 100644 index 000000000000..de0126130f97 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringModels.cs @@ -0,0 +1,1644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations.Authoring +{ + // Data plane generated sub-client. + /// The ConversationAuthoringModels sub-client. + public partial class ConversationAuthoringModels + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 ConversationAuthoringModels for mocking. + protected ConversationAuthoringModels() + { + } + + /// Initializes a new instance of ConversationAuthoringModels. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal ConversationAuthoringModels(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainedModel(projectName, trainedModelLabel, context); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(EvaluationOperationState.FromResponse(response), response); + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(EvaluationOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(LoadSnapshotOperationState.FromResponse(response), response); + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(LoadSnapshotOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModel(projectName, exportedModelName, context); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportedModel(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelOperationState.FromResponse(response), response); + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); + return Response.FromValue(ExportedModelOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "ConversationAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "ConversationAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" | "Utf8CodeUnit" | "Utf32CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" | "Utf8CodeUnit" | "Utf32CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ConversationAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// Triggers evaluation operation on a trained model. + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationOperationState, ClientDiagnostics, "ConversationAuthoringModels.EvaluateModel"); + } + + /// Triggers evaluation operation on a trained model. + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationOperationState, ClientDiagnostics, "ConversationAuthoringModels.EvaluateModel"); + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Restores the snapshot of this trained model to be the current working directory of the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Restores the snapshot of this trained model to be the current working directory of the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new exported model or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); + } + + /// Creates a new exported model or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringModels.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringModels.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:evaluate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:load-snapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluate/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/result", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/summary-result", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/load-snapshot/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private EvaluationJobResult FetchEvaluationJobResultFromEvaluationOperationState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringProjects.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringProjects.cs new file mode 100644 index 000000000000..166ad67a3b6a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationAuthoringProjects.cs @@ -0,0 +1,1884 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations.Authoring +{ + // Data plane generated sub-client. + /// The ConversationAuthoringProjects sub-client. + public partial class ConversationAuthoringProjects + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 ConversationAuthoringProjects for mocking. + protected ConversationAuthoringProjects() + { + } + + /// Initializes a new instance of ConversationAuthoringProjects. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal ConversationAuthoringProjects(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProject(projectName, context); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetProjectAsync(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetProject(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new project or updates an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new project or updates an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeletionOperationState.FromResponse(response), response); + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProjectDeletionStatus(jobId, context); + return Response.FromValue(ProjectDeletionOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetProjectDeletionStatusAsync(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetProjectDeletionStatus(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, 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 new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportProjectOperationState.FromResponse(response), response); + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportStatus(projectName, jobId, context); + return Response.FromValue(ExportProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ImportProjectOperationState.FromResponse(response), response); + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImportStatus(projectName, jobId, context); + return Response.FromValue(ImportProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> AuthorizeProjectCopyAsync(string projectName, AnalyzeConversationAuthoringProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AuthorizeProjectCopyAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response AuthorizeProjectCopy(string projectName, AnalyzeConversationAuthoringProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AuthorizeProjectCopy(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task AuthorizeProjectCopyAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.AuthorizeProjectCopy"); + scope.Start(); + try + { + using HttpMessage message = CreateAuthorizeProjectCopyRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response AuthorizeProjectCopy(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.AuthorizeProjectCopy"); + scope.Start(); + try + { + using HttpMessage message = CreateAuthorizeProjectCopyRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(CopyProjectOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCopyProjectStatus(projectName, jobId, context); + return Response.FromValue(CopyProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetCopyProjectStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TrainingOperationState.FromResponse(response), response); + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingStatus(projectName, jobId, context); + return Response.FromValue(TrainingOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTrainingStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to export a project's data. + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The format of the exported project file to use. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, AnalyzeConversationAuthoringExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); + } + + /// Triggers a job to export a project's data. + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The format of the exported project file to use. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, AnalyzeConversationAuthoringExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context); + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" | "Utf8CodeUnit" | "Utf32CodeUnit". + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" | "Utf8CodeUnit" | "Utf32CodeUnit". + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Export(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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. + /// The name of the project to use. + /// The project data to import. + /// The format of the exported project file to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject exportedProject, AnalyzeConversationAuthoringExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(exportedProject, nameof(exportedProject)); + + using RequestContent content = exportedProject.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportAsync(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context).ConfigureAwait(false); + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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. + /// The name of the project to use. + /// The project data to import. + /// The format of the exported project file to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject exportedProject, AnalyzeConversationAuthoringExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(exportedProject, nameof(exportedProject)); + + using RequestContent content = exportedProject.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return Import(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context); + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Copies an existing project to another Azure resource. + /// 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. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Copies an existing project to another Azure resource. + /// 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. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CopyProject(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a training job for a project. + /// 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. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingOperationState, ClientDiagnostics, "ConversationAuthoringProjects.Train"); + } + + /// Triggers a training job for a project. + /// 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. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(details, nameof(details)); + + using RequestContent content = details.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Train(waitUntil, projectName, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingOperationState, ClientDiagnostics, "ConversationAuthoringProjects.Train"); + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a cancellation for a running training 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. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingOperationState, ClientDiagnostics, "ConversationAuthoringProjects.CancelTrainingJob"); + } + + /// Triggers a cancellation for a running training 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. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingOperationState, ClientDiagnostics, "ConversationAuthoringProjects.CancelTrainingJob"); + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("ConversationAuthoringProjects.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationAuthoringProjects.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateExportRequest(string projectName, string stringIndexType, string exportedProjectFormat, string assetKind, string trainedModelLabel, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, true); + } + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + if (trainedModelLabel != null) + { + uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string exportedProjectFormat, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + return message; + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/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"); + return message; + } + + internal HttpMessage CreateAuthorizeProjectCopyRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:authorize-copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateCopyProjectRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetCopyProjectStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/copy/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:train", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string 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("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/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 RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private TrainingJobResult FetchTrainingJobResultFromTrainingOperationState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs index 0f7695000f64..c63a8dca692b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs @@ -15,80 +15,44 @@ namespace Azure.AI.Language.Conversations.Authoring /// Model factory for models. public static partial class ConversationsAuthoringModelFactory { - /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project creation datetime. - /// Represents the project last trained datetime. - /// Represents the project last deployed datetime. - /// Represents the project kind. - /// The project settings. - /// The storage container name in case of conversation summarization. - /// The new project name. - /// Whether the project would be used for multiple languages or not. - /// The project description. - /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) - { - return new ProjectMetadata( - createdDateTime, - lastModifiedDateTime, - lastTrainedDateTime, - lastDeployedDateTime, - projectKind, - settings, - storageInputContainerName, - projectName, - multilingual, - description, - language, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// - /// An object containing more specific information than the current object about - /// the error. - /// - /// A new instance for mocking. - public static AuthoringConversationsError AuthoringConversationsError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedOn = default, DateTimeOffset lastDeployedOn = default, DateTimeOffset deploymentExpiredOn = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) { - details ??= new List(); + assignedResources ??= new List(); - return new AuthoringConversationsError( - code, - message, - target, - details?.ToList(), - innererror, + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedOn, + lastDeployedOn, + deploymentExpiredOn, + modelTrainingConfigVersion, + assignedResources?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// Error details. - /// Error target. - /// An object containing more specific information than the current object about the error. - /// A new instance for mocking. - public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null) + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) { - details ??= new Dictionary(); - - return new InnerErrorModel( - code, - message, - details, - target, - innererror, - serializedAdditionalRawData: null); + return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. /// Represents the project kind. /// The project settings. /// The storage container name in case of conversation summarization. @@ -96,10 +60,14 @@ public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, str /// Whether the project would be used for multiple languages or not. /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static CreateProjectDetails CreateProjectDetails(ProjectKind projectKind = default, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + /// A new instance for mocking. + public static ProjectMetadata ProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, AnalyzeConversationAuthoringProjectKind projectKind = default, AnalyzeConversationAuthoringProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) { - return new CreateProjectDetails( + return new ProjectMetadata( + createdOn, + lastModifiedOn, + lastTrainedOn, + lastDeployedOn, projectKind, settings, storageInputContainerName, @@ -110,253 +78,100 @@ public static CreateProjectDetails CreateProjectDetails(ProjectKind projectKind serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new ProjectDeletionJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// A new instance for mocking. - public static AuthoringConversationsWarning AuthoringConversationsWarning(string code = null, string message = null) - { - return new AuthoringConversationsWarning(code, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static CopyProjectJobState CopyProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new CopyProjectJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// The URL to use in order to download the exported project. - /// A new instance for mocking. - public static ExportProjectJobState ExportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new ExportProjectJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - resultUrl, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The version of the exported file. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// Represents the project metadata. - /// - /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// A new instance for mocking. - public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectDetails metadata = null, ExportedProjectAssets assets = null) - { - return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The category of the entity. - /// The behavior to follow when the entity's components overlap with each other. - /// The list component of the entity. - /// The prebuilt entities components. - /// The regex component of the entity. - /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. - /// A new instance for mocking. - public static ConversationExportedEntity ConversationExportedEntity(string category = null, CompositionSetting? compositionSetting = null, ExportedEntityList list = null, IEnumerable prebuilts = null, ExportedEntityRegex regex = null, IEnumerable requiredComponents = null) - { - prebuilts ??= new List(); - requiredComponents ??= new List(); - - return new ConversationExportedEntity( - category, - compositionSetting, - list, - prebuilts?.ToList(), - regex, - requiredComponents?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents the entity labels of the utterance. - /// The utterance text. - /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// The intent of the utterance. - /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. - /// A new instance for mocking. - public static ConversationExportedUtterance ConversationExportedUtterance(IEnumerable entities = null, string text = null, string language = null, string intent = null, string dataset = null) + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) { - entities ??= new List(); - - return new ConversationExportedUtterance( - entities?.ToList(), - text, - language, - intent, - dataset, - serializedAdditionalRawData: null); + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// - /// Specifies the behavior of this intent in the orchestration flow. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// The intent category. - /// A new instance for mocking. - public static OrchestrationExportedIntent OrchestrationExportedIntent(ExportedOrchestrationDetails orchestration = null, string category = null) + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// A new instance for mocking. + public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) { - return new OrchestrationExportedIntent(orchestration, category, serializedAdditionalRawData: null); - } + deploymentsMetadata ??= new List(); - /// Initializes a new instance of . - /// The Conversational project target details. - /// A new instance for mocking. - public static ExportedConversationOrchestrationDetails ExportedConversationOrchestrationDetails(ExportedConversationOrchestration conversationOrchestration = null) - { - return new ExportedConversationOrchestrationDetails(OrchestrationTargetProjectKind.Conversation, serializedAdditionalRawData: null, conversationOrchestration); + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The LUIS application target details. - /// A new instance for mocking. - public static ExportedLuisOrchestrationDetails ExportedLuisOrchestrationDetails(ExportedLuisOrchestration luisOrchestration = null) + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// A new instance for mocking. + public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedOn = default, DateTimeOffset deploymentExpiresOn = default) { - return new ExportedLuisOrchestrationDetails(OrchestrationTargetProjectKind.Luis, serializedAdditionalRawData: null, luisOrchestration); + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedOn, deploymentExpiresOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The LUIS application ID. - /// The targeted version Id. - /// The targeted slot name. - /// A new instance for mocking. - public static ExportedLuisOrchestration ExportedLuisOrchestration(Guid appId = default, string appVersion = null, string slotName = null) + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// A new instance for mocking. + public static AssignedDeploymentResource AssignedDeploymentResource(string resourceId = null, string region = null) { - return new ExportedLuisOrchestration(appId, appVersion, slotName, serializedAdditionalRawData: null); + return new AssignedDeploymentResource(resourceId, region, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Question Answering project details. - /// A new instance for mocking. - public static ExportedQuestionAnsweringOrchestrationDetails ExportedQuestionAnsweringOrchestrationDetails(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// A new instance for mocking. + public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) { - return new ExportedQuestionAnsweringOrchestrationDetails(OrchestrationTargetProjectKind.QuestionAnswering, serializedAdditionalRawData: null, questionAnsweringOrchestration); + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The utterance text. - /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// The intent of the utterance. - /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. - /// A new instance for mocking. - public static OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// A new instance for mocking. + public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpiredOn = default) { - return new OrchestrationExportedUtterance(text, language, intent, dataset, serializedAdditionalRawData: null); + return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpiredOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ImportProjectJobState ImportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static TrainingOperationState TrainingOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new ImportProjectJobState( + return new TrainingOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), + result, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the output model label. - /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. - /// Represents the mode of the training operation. - /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. - /// A new instance for mocking. - public static TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, TrainingMode trainingMode = default, EvaluationDetails evaluationOptions = null) - { - return new TrainingJobDetails(modelLabel, trainingConfigVersion, trainingMode, evaluationOptions, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Represents trained model label. /// Represents training config version. /// Represents the mode of the training operation. /// Represents the model training status. /// Represents model evaluation status. - /// Represents the estimated end date time for training and evaluation. + /// Represents the estimated end date time for training and evaluation. /// A new instance for mocking. - public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, TrainingMode? trainingMode = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, AnalyzeConversationAuthoringTrainingMode? trainingMode = null, SubTrainingOperationState trainingStatus = null, SubTrainingOperationState evaluationStatus = null, DateTimeOffset? estimatedEndOn = null) { return new TrainingJobResult( modelLabel, @@ -364,220 +179,94 @@ public static TrainingJobResult TrainingJobResult(string modelLabel = null, stri trainingMode, trainingStatus, evaluationStatus, - estimatedEndDateTime, + estimatedEndOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. - /// Represents the start date time. - /// Represents the end date time. + /// Represents the start date time. + /// Represents the end date time. /// Represents the status of the sub-operation. - /// A new instance for mocking. - public static SubTrainingJobState SubTrainingJobState(int percentComplete = default, DateTimeOffset? startDateTime = null, DateTimeOffset? endDateTime = null, JobStatus status = default) - { - return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// Represents training tasks detailed result. - /// A new instance for mocking. - public static TrainingJobState TrainingJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) + /// A new instance for mocking. + public static SubTrainingOperationState SubTrainingOperationState(int percentComplete = default, DateTimeOffset? startedOn = null, DateTimeOffset? endedOn = null, ConversationAuthoringOperationStatus status = default) { - warnings ??= new List(); - errors ??= new List(); - - return new TrainingJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - result, - serializedAdditionalRawData: null); + return new SubTrainingOperationState(percentComplete, startedOn, endedOn, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents deployment name. - /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. - /// Represents model training config version. - /// Represents the metadata of the assigned Azure resources. - /// A new instance for mocking. - public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedOn = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpiredOn = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) { - assignedResources ??= new List(); - - return new ProjectDeployment( - deploymentName, + return new ProjectTrainedModel( + label, modelId, - lastTrainedDateTime, - lastDeployedDateTime, - deploymentExpirationDate, + lastTrainedOn, + lastTrainingDurationInSeconds, + modelExpiredOn, modelTrainingConfigVersion, - assignedResources?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents the Azure resource Id. - /// Represents the resource region. - /// A new instance for mocking. - public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) - { - return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new SwapDeploymentsJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents the trained model label. - /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. - /// A new instance for mocking. - public static CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) - { - assignedResourceIds ??= new List(); - - return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static DeploymentJobState DeploymentJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new DeploymentJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new DeploymentDeleteFromResourcesJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), + hasSnapshot, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The trained model label. + /// Initializes a new instance of . + /// The exported model name. /// The model ID. - /// The last trained date time of the model. - /// The duration of the model's last training request in seconds. - /// The model expiration date. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. /// The model training config version. - /// The flag to indicate if the trained model has a snapshot ready. - /// A new instance for mocking. - public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) + /// A new instance for mocking. + public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedOn = default, DateTimeOffset lastExportedModelOn = default, DateTimeOffset modelExpiredOn = default, string modelTrainingConfigVersion = null) { - return new ProjectTrainedModel( - label, + return new ExportedTrainedModel( + exportedModelName, modelId, - lastTrainedDateTime, - lastTrainingDurationInSeconds, - modelExpirationDate, + lastTrainedOn, + lastExportedModelOn, + modelExpiredOn, modelTrainingConfigVersion, - hasSnapshot, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Represents the options used running the evaluation. + /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. /// A new instance for mocking. - public static EvaluationJobResult EvaluationJobResult(EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) + public static EvaluationJobResult EvaluationJobResult(EvaluationDetails evaluationDetails = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) { - return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); + return new EvaluationJobResult(evaluationDetails, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents evaluation task detailed result. - /// A new instance for mocking. - public static EvaluationJobState EvaluationJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) + /// A new instance for mocking. + public static EvaluationOperationState EvaluationOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new EvaluationJobState( + return new EvaluationOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), @@ -585,25 +274,25 @@ public static EvaluationJobState EvaluationJobState(string jobId = null, DateTim serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static LoadSnapshotOperationState LoadSnapshotOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new LoadSnapshotJobState( + return new LoadSnapshotOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), @@ -672,8 +361,9 @@ public static EvaluationSummary EvaluationSummary(EntitiesEvaluationSummary enti /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// A new instance for mocking. - public static EntitiesEvaluationSummary EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + public static EntitiesEvaluationSummary EntitiesEvaluationSummary(IReadOnlyDictionary confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) { + confusionMatrix ??= new Dictionary(); entities ??= new Dictionary(); return new EntitiesEvaluationSummary( @@ -688,39 +378,29 @@ public static EntitiesEvaluationSummary EntitiesEvaluationSummary(ConfusionMatri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Additional Properties. - /// A new instance for mocking. - public static ConfusionMatrix ConfusionMatrix(IReadOnlyDictionary additionalProperties = null) - { - additionalProperties ??= new Dictionary(); - - return new ConfusionMatrix(additionalProperties); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// Additional Properties. - /// A new instance for mocking. - public static ConfusionMatrixRow ConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) + /// A new instance for mocking. + public static AnalyzeConversationConfusionMatrixRow AnalyzeConversationConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) { additionalProperties ??= new Dictionary(); - return new ConfusionMatrixRow(additionalProperties); + return new AnalyzeConversationConfusionMatrixRow(additionalProperties); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. - /// A new instance for mocking. - public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = default, float rawValue = default) + /// A new instance for mocking. + public static AnalyzeConversationAuthoringConfusionMatrixCell AnalyzeConversationAuthoringConfusionMatrixCell(float normalizedValue = default, float rawValue = default) { - return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); + return new AnalyzeConversationAuthoringConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Represents the model precision. - /// Represents the model recall. - /// Represents the model F1 score. + /// Represents the model F1 score. + /// Represents the model precision. + /// Represents the model precision. /// Represents the count of true positive. /// Represents the count of true negative. /// Represents the count of false positive. @@ -749,8 +429,9 @@ public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = defaul /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// A new instance for mocking. - public static IntentsEvaluationSummary IntentsEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary intents = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + public static IntentsEvaluationSummary IntentsEvaluationSummary(IReadOnlyDictionary confusionMatrix = null, IReadOnlyDictionary intents = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) { + confusionMatrix ??= new Dictionary(); intents ??= new Dictionary(); return new IntentsEvaluationSummary( @@ -787,172 +468,387 @@ public static IntentEvaluationSummary IntentEvaluationSummary(double f1 = defaul serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The resource ID. - /// The resource region. - /// A new instance for mocking. - public static AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ExportedModelOperationState ExportedModelOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ExportedModelOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static CreateProjectDetails CreateProjectDetails(AnalyzeConversationAuthoringProjectKind projectKind = default, AnalyzeConversationAuthoringProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) { - return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); + return new CreateProjectDetails( + projectKind, + settings, + storageInputContainerName, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static DeploymentResourcesJobState DeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static ProjectDeletionOperationState ProjectDeletionOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new DeploymentResourcesJobState( + return new ProjectDeletionOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The list of retrieved assigned project deployments. - /// The next page link. - /// A new instance for mocking. - public static AssignedResourceDeploymentsMetadata AssignedResourceDeploymentsMetadata(IEnumerable value = null, string nextLink = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// A new instance for mocking. + public static ExportProjectOperationState ExportProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUri = null) { - value ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new AssignedResourceDeploymentsMetadata(value?.ToList(), nextLink, serializedAdditionalRawData: null); + return new ExportProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + resultUri, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the project name. - /// Represents the resource region. - /// A new instance for mocking. - public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectDetails metadata = null, ExportedProjectAsset assets = null) { - deploymentsMetadata ??= new List(); + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } - return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); + /// Initializes a new instance of . + /// The category of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The regex component of the entity. + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + /// A new instance for mocking. + public static ConversationExportedEntity ConversationExportedEntity(string category = null, AnalyzeConversationAuthoringCompositionMode? compositionMode = null, ExportedEntityList entities = null, IEnumerable prebuilts = null, ExportedEntityRegex regex = null, IEnumerable requiredComponents = null) + { + prebuilts ??= new List(); + requiredComponents ??= new List(); + + return new ConversationExportedEntity( + category, + compositionMode, + entities, + prebuilts?.ToList(), + regex, + requiredComponents?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. - /// A new instance for mocking. - public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default) + /// Initializes a new instance of . + /// Represents the entity labels of the utterance. + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ConversationExportedUtterance ConversationExportedUtterance(IEnumerable entities = null, string text = null, string language = null, string intent = null, DatasetType? dataset = null) + { + entities ??= new List(); + + return new ConversationExportedUtterance( + entities?.ToList(), + text, + language, + intent, + dataset, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// The intent category. + /// A new instance for mocking. + public static OrchestrationExportedIntent OrchestrationExportedIntent(ExportedOrchestrationDetails orchestration = null, string category = null) + { + return new OrchestrationExportedIntent(orchestration, category, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Conversational project target details. + /// A new instance for mocking. + public static ExportedConversationOrchestrationDetails ExportedConversationOrchestrationDetails(ExportedConversationOrchestration conversationOrchestration = null) { - return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData: null); + return new ExportedConversationOrchestrationDetails(OrchestrationTargetProjectKind.Conversation, serializedAdditionalRawData: null, conversationOrchestration); } - /// Initializes a new instance of . - /// The list of the languages. - /// The next page link. - /// A new instance for mocking. - public static SupportedLanguages SupportedLanguages(IEnumerable value = null, string nextLink = null) + /// Initializes a new instance of . + /// The LUIS application target details. + /// A new instance for mocking. + public static ExportedLuisOrchestrationDetails ExportedLuisOrchestrationDetails(ExportedLuisOrchestration luisOrchestration = null) { - value ??= new List(); + return new ExportedLuisOrchestrationDetails(OrchestrationTargetProjectKind.Luis, serializedAdditionalRawData: null, luisOrchestration); + } - return new SupportedLanguages(value?.ToList(), nextLink, serializedAdditionalRawData: null); + /// Initializes a new instance of . + /// The LUIS application ID. + /// The targeted version Id. + /// The targeted slot name. + /// A new instance for mocking. + public static ExportedLuisOrchestration ExportedLuisOrchestration(Guid appId = default, string appVersion = null, string slotName = null) + { + return new ExportedLuisOrchestration(appId, appVersion, slotName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The language name. - /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) + /// Initializes a new instance of . + /// The Question Answering project details. + /// A new instance for mocking. + public static ExportedQuestionAnsweringOrchestrationDetails ExportedQuestionAnsweringOrchestrationDetails(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) { - return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); + return new ExportedQuestionAnsweringOrchestrationDetails(OrchestrationTargetProjectKind.QuestionAnswering, serializedAdditionalRawData: null, questionAnsweringOrchestration); + } + + /// Initializes a new instance of . + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) + { + return new OrchestrationExportedUtterance(text, language, intent, dataset, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The supported prebuilt entities. - /// The next page link. - /// A new instance for mocking. - public static PrebuiltEntities PrebuiltEntities(IEnumerable value = null, string nextLink = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ImportProjectOperationState ImportProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - value ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new PrebuiltEntities(value?.ToList(), nextLink, serializedAdditionalRawData: null); + return new ImportProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The prebuilt entity category. - /// The description. - /// English examples for the entity. - /// A new instance for mocking. - public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static CopyProjectOperationState CopyProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new CopyProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. + /// Represents the mode of the training operation. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// A new instance for mocking. + public static TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, AnalyzeConversationAuthoringTrainingMode trainingMode = default, EvaluationDetails evaluationOptions = null) + { + return new TrainingJobDetails(modelLabel, trainingConfigVersion, trainingMode, evaluationOptions, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The list of the training config versions. - /// The next page link. - /// A new instance for mocking. - public static TrainingConfigVersions TrainingConfigVersions(IEnumerable value = null, string nextLink = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static SwapDeploymentsOperationState SwapDeploymentsOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - value ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new TrainingConfigVersions(value?.ToList(), nextLink, serializedAdditionalRawData: null); + return new SwapDeploymentsOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the version of the config. - /// Represents the training config version expiration date. - /// A new instance for mocking. - public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpirationDate = default) + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// A new instance for mocking. + public static CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentOperationState DeploymentOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpirationDate, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The exported model name. - /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. - /// The model training config version. - /// A new instance for mocking. - public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentDeleteFromResourcesOperationState DeploymentDeleteFromResourcesOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new ExportedTrainedModel( - exportedModelName, - modelId, - lastTrainedDateTime, - lastExportedModelDateTime, - modelExpirationDate, - modelTrainingConfigVersion, + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentDeleteFromResourcesOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ExportedModelJobState ExportedModelJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static DeploymentResourcesOperationState DeploymentResourcesOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, ConversationAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new ExportedModelJobState( + return new DeploymentResourcesOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml deleted file mode 100644 index ad7f0d4545c2..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml +++ /dev/null @@ -1,5911 +0,0 @@ - - - - - -This sample shows how to call GetProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync(""); -]]> -This sample shows how to call GetProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync(""); -]]> - - - -This sample shows how to call GetProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject(""); -]]> -This sample shows how to call GetProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject(""); -]]> - - - -This sample shows how to call GetProjectAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call GetProjectAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call GetProject and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call GetProject with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CreateProjectAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - projectName = "", - language = "", -}); -Response response = await client.CreateProjectAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", -}); -Response response = await client.CreateProjectAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CreateProject and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - projectName = "", - language = "", -}); -Response response = client.CreateProject("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call CreateProject with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", -}); -Response response = client.CreateProject("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CopyProjectAuthorizationAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); -]]> -This sample shows how to call CopyProjectAuthorizationAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); -]]> - - - -This sample shows how to call CopyProjectAuthorization. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); -]]> -This sample shows how to call CopyProjectAuthorization with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); -]]> - - - -This sample shows how to call CopyProjectAuthorizationAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", -}); -Response response = await client.CopyProjectAuthorizationAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> -This sample shows how to call CopyProjectAuthorizationAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - storageInputContainerName = "", - allowOverwrite = true, -}); -Response response = await client.CopyProjectAuthorizationAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> - - - -This sample shows how to call CopyProjectAuthorization and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", -}); -Response response = client.CopyProjectAuthorization("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> -This sample shows how to call CopyProjectAuthorization with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - storageInputContainerName = "", - allowOverwrite = true, -}); -Response response = client.CopyProjectAuthorization("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> - - - -This sample shows how to call GetCopyProjectStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", ""); -]]> -This sample shows how to call GetCopyProjectStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", ""); -]]> - - - -This sample shows how to call GetCopyProjectStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", ""); -]]> -This sample shows how to call GetCopyProjectStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", ""); -]]> - - - -This sample shows how to call GetCopyProjectStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetCopyProjectStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetCopyProjectStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetCopyProjectStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", ""); -]]> -This sample shows how to call GetDeploymentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", ""); -]]> - - - -This sample shows how to call GetDeployment. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", ""); -]]> -This sample shows how to call GetDeployment with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", ""); -]]> - - - -This sample shows how to call GetDeploymentAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> -This sample shows how to call GetDeploymentAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> - - - -This sample shows how to call GetDeployment and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> -This sample shows how to call GetDeployment with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", ""); -]]> -This sample shows how to call GetDeploymentStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", ""); -]]> -This sample shows how to call GetDeploymentStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", ""); -]]> -This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", ""); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", ""); -]]> -This sample shows how to call GetSwapDeploymentsStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", ""); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetSwapDeploymentsStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetExportStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", ""); -]]> -This sample shows how to call GetExportStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", ""); -]]> - - - -This sample shows how to call GetExportStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", ""); -]]> -This sample shows how to call GetExportStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", ""); -]]> - - - -This sample shows how to call GetExportStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("resultUrl").ToString()); -]]> - - - -This sample shows how to call GetExportStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("resultUrl").ToString()); -]]> - - - -This sample shows how to call GetImportStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", ""); -]]> -This sample shows how to call GetImportStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", ""); -]]> - - - -This sample shows how to call GetImportStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", ""); -]]> -This sample shows how to call GetImportStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", ""); -]]> - - - -This sample shows how to call GetImportStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetImportStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetImportStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetImportStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetTrainedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", ""); -]]> -This sample shows how to call GetTrainedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", ""); -]]> - - - -This sample shows how to call GetTrainedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", ""); -]]> -This sample shows how to call GetTrainedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", ""); -]]> - - - -This sample shows how to call GetTrainedModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> -This sample shows how to call GetTrainedModelAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> - - - -This sample shows how to call GetTrainedModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> -This sample shows how to call GetTrainedModel with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> - - - -This sample shows how to call DeleteTrainedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.DeleteTrainedModelAsync("", ""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteTrainedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.DeleteTrainedModelAsync("", ""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteTrainedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.DeleteTrainedModel("", ""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteTrainedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.DeleteTrainedModel("", ""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetEvaluationStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", ""); -]]> -This sample shows how to call GetEvaluationStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetEvaluationStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", ""); -]]> -This sample shows how to call GetEvaluationStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", ""); -]]> - - - -This sample shows how to call GetEvaluationStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call GetEvaluationStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call GetEvaluationStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call GetEvaluationStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call GetModelEvaluationSummaryAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", ""); -]]> -This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", ""); -]]> - - - -This sample shows how to call GetModelEvaluationSummary. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", ""); -]]> -This sample shows how to call GetModelEvaluationSummary with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", ""); -]]> - - - -This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); -]]> -This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -]]> - - - -This sample shows how to call GetModelEvaluationSummary and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); -]]> -This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); -Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -]]> - - - -This sample shows how to call GetLoadSnapshotStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); -]]> -This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetLoadSnapshotStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", ""); -]]> -This sample shows how to call GetLoadSnapshotStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", ""); -]]> - - - -This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetLoadSnapshotStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetLoadSnapshotStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetLoadSnapshotStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", ""); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", ""); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", ""); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", ""); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetTrainingStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", ""); -]]> -This sample shows how to call GetTrainingStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", ""); -]]> - - - -This sample shows how to call GetTrainingStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", ""); -]]> -This sample shows how to call GetTrainingStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", ""); -]]> - - - -This sample shows how to call GetTrainingStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call GetTrainingStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call GetTrainingStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call GetTrainingStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call GetProjectDeletionStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync(""); -]]> -This sample shows how to call GetProjectDeletionStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync(""); -]]> - - - -This sample shows how to call GetProjectDeletionStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus(""); -]]> -This sample shows how to call GetProjectDeletionStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus(""); -]]> - - - -This sample shows how to call GetProjectDeletionStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetProjectDeletionStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetProjectDeletionStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetProjectDeletionStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetAssignedResourceDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignedResourceDeploymentsAsync(); -]]> -This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetAssignedResourceDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignedResourceDeployments(); -]]> -This sample shows how to call GetAssignedResourceDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -]]> -This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetAssignedResourceDeployments and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignedResourceDeployments(null, null, null, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -]]> -This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetSupportedLanguagesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); -]]> -This sample shows how to call GetSupportedLanguagesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetSupportedLanguages. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedLanguages(ProjectKind.Conversation); -]]> -This sample shows how to call GetSupportedLanguages with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetSupportedLanguagesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedLanguagesAsync("Conversation"); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); -]]> -This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetSupportedLanguages and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedLanguages("Conversation"); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); -]]> -This sample shows how to call GetSupportedLanguages with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntitiesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedPrebuiltEntitiesAsync(); -]]> -This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntities. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedPrebuiltEntities(); -]]> -This sample shows how to call GetSupportedPrebuiltEntities with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); -]]> -This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntities and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); -]]> -This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetTrainingConfigVersionsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); -]]> -This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetTrainingConfigVersions. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); -]]> -This sample shows how to call GetTrainingConfigVersions with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); -]]> - - - -This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); -]]> -This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetTrainingConfigVersions and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingConfigVersions("Conversation"); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); -]]> -This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("nextLink").ToString()); -]]> - - - -This sample shows how to call GetExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", ""); -]]> -This sample shows how to call GetExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", ""); -]]> - - - -This sample shows how to call GetExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", ""); -]]> -This sample shows how to call GetExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", ""); -]]> - - - -This sample shows how to call GetExportedModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> -This sample shows how to call GetExportedModelAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> - - - -This sample shows how to call GetExportedModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> -This sample shows how to call GetExportedModel with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> - - - -This sample shows how to call GetExportedModelJobStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", ""); -]]> -This sample shows how to call GetExportedModelJobStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetExportedModelJobStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", ""); -]]> -This sample shows how to call GetExportedModelJobStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", ""); -]]> - - - -This sample shows how to call GetExportedModelJobStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportedModelJobStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetExportedModelJobStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportedModelJobStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetProjectsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectMetadata item in client.GetProjectsAsync()) -{ -} -]]> -This sample shows how to call GetProjectsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetProjects. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectMetadata item in client.GetProjects()) -{ -} -]]> -This sample shows how to call GetProjects with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetProjectsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetProjectsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetProjects and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetProjects(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetProjects with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) -{ -} -]]> -This sample shows how to call GetDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectDeployment item in client.GetDeployments("")) -{ -} -]]> -This sample shows how to call GetDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetDeployments and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeployments with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetTrainedModelsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) -{ -} -]]> -This sample shows how to call GetTrainedModelsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainedModels. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectTrainedModel item in client.GetTrainedModels("")) -{ -} -]]> -This sample shows how to call GetTrainedModels with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainedModelsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> -This sample shows how to call GetTrainedModelsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> - - - -This sample shows how to call GetTrainedModels and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> -This sample shows how to call GetTrainedModels with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> - - - -This sample shows how to call GetModelEvaluationResultsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) -{ -} -]]> -This sample shows how to call GetModelEvaluationResultsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetModelEvaluationResults. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) -{ -} -]]> -This sample shows how to call GetModelEvaluationResults with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetModelEvaluationResultsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); -} -]]> -This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); -} -]]> - - - -This sample shows how to call GetModelEvaluationResults and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); -} -]]> -This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) -{ -} -]]> -This sample shows how to call GetDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) -{ -} -]]> -This sample shows how to call GetDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentResourcesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentResourcesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentResources and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentResources with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingJobsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) -{ -} -]]> -This sample shows how to call GetTrainingJobsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingJobs. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingJobState item in client.GetTrainingJobs("")) -{ -} -]]> -This sample shows how to call GetTrainingJobs with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingJobsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -} -]]> -This sample shows how to call GetTrainingJobsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingJobs and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -} -]]> -This sample shows how to call GetTrainingJobs with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -} -]]> - - - -This sample shows how to call GetExportedModelsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) -{ -} -]]> -This sample shows how to call GetExportedModelsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetExportedModels. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ExportedTrainedModel item in client.GetExportedModels("")) -{ -} -]]> -This sample shows how to call GetExportedModels with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetExportedModelsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> -This sample shows how to call GetExportedModelsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> - - - -This sample shows how to call GetExportedModels and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> -This sample shows how to call GetExportedModels with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> - - - -This sample shows how to call DeleteProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); -]]> -This sample shows how to call DeleteProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); -]]> - - - -This sample shows how to call DeleteProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteProject(WaitUntil.Completed, ""); -]]> -This sample shows how to call DeleteProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteProject(WaitUntil.Completed, ""); -]]> - - - -This sample shows how to call CopyProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.Conversation, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call CopyProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.Conversation, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call CopyProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.Conversation, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = client.CopyProject(WaitUntil.Completed, "", body); -]]> -This sample shows how to call CopyProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.Conversation, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = client.CopyProject(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call CopyProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call CopyProjectAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call CopyProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = client.CopyProject(WaitUntil.Completed, "", content); -]]> -This sample shows how to call CopyProject with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = client.CopyProject(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call ExportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); -]]> -This sample shows how to call ExportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call Export. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); -]]> -This sample shows how to call Export with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call ExportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); -]]> -This sample shows how to call ExportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call Export. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); -]]> -This sample shows how to call Export with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call ImportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call ImportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") -{ - Settings = new ProjectSettings(123.45F), - StorageInputContainerName = "", - Multilingual = true, - Description = "", -}) -{ - Assets = new ConversationExportedProjectAssets - { - Intents = { new ConversationExportedIntent("") }, - Entities = {new ConversationExportedEntity("") - { - CompositionSetting = CompositionSetting.ReturnLongestOverlap, - List = new ExportedEntityList - { - Sublists = {new ExportedEntitySublist - { - ListKey = "", - Synonyms = {new ExportedEntityListSynonym - { - Language = "", - Values = {""}, - }}, - }}, - }, - Prebuilts = {new ExportedPrebuiltEntity("")}, - Regex = new ExportedEntityRegex - { - Expressions = {new ExportedEntityRegexExpression - { - RegexKey = "", - Language = "", - RegexPattern = "", - }}, - }, - RequiredComponents = {""}, - }}, - Utterances = {new ConversationExportedUtterance("", "") - { - Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, - Language = "", - Dataset = "", - }}, - }, -}; -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); -]]> - - - -This sample shows how to call Import. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); -Operation operation = client.Import(WaitUntil.Completed, "", body); -]]> -This sample shows how to call Import with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") -{ - Settings = new ProjectSettings(123.45F), - StorageInputContainerName = "", - Multilingual = true, - Description = "", -}) -{ - Assets = new ConversationExportedProjectAssets - { - Intents = { new ConversationExportedIntent("") }, - Entities = {new ConversationExportedEntity("") - { - CompositionSetting = CompositionSetting.ReturnLongestOverlap, - List = new ExportedEntityList - { - Sublists = {new ExportedEntitySublist - { - ListKey = "", - Synonyms = {new ExportedEntityListSynonym - { - Language = "", - Values = {""}, - }}, - }}, - }, - Prebuilts = {new ExportedPrebuiltEntity("")}, - Regex = new ExportedEntityRegex - { - Expressions = {new ExportedEntityRegexExpression - { - RegexKey = "", - Language = "", - RegexPattern = "", - }}, - }, - RequiredComponents = {""}, - }}, - Utterances = {new ConversationExportedUtterance("", "") - { - Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, - Language = "", - Dataset = "", - }}, - }, -}; -Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); -]]> - - - -This sample shows how to call ImportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - projectName = "", - language = "", - }, -}); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call ImportAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - intents = new object[] - { - new - { - category = "", - } - }, - entities = new object[] - { - new - { - category = "", - compositionSetting = "returnLongestOverlap", - list = new - { - sublists = new object[] - { - new - { - listKey = "", - synonyms = new object[] - { - new - { - language = "", - values = new object[] - { - "" - }, - } - }, - } - }, - }, - prebuilts = new object[] - { - new - { - category = "", - } - }, - regex = new - { - expressions = new object[] - { - new - { - regexKey = "", - language = "", - regexPattern = "", - } - }, - }, - requiredComponents = new object[] - { - "" - }, - } - }, - utterances = new object[] - { - new - { - entities = new object[] - { - new - { - category = "", - offset = 1234, - length = 1234, - } - }, - text = "", - language = "", - intent = "", - dataset = "", - } - }, - projectKind = "Conversation", - }, -}); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); -]]> - - - -This sample shows how to call Import. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - projectName = "", - language = "", - }, -}); -Operation operation = client.Import(WaitUntil.Completed, "", content); -]]> -This sample shows how to call Import with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - intents = new object[] - { - new - { - category = "", - } - }, - entities = new object[] - { - new - { - category = "", - compositionSetting = "returnLongestOverlap", - list = new - { - sublists = new object[] - { - new - { - listKey = "", - synonyms = new object[] - { - new - { - language = "", - values = new object[] - { - "" - }, - } - }, - } - }, - }, - prebuilts = new object[] - { - new - { - category = "", - } - }, - regex = new - { - expressions = new object[] - { - new - { - regexKey = "", - language = "", - regexPattern = "", - } - }, - }, - requiredComponents = new object[] - { - "" - }, - } - }, - utterances = new object[] - { - new - { - entities = new object[] - { - new - { - category = "", - offset = 1234, - length = 1234, - } - }, - text = "", - language = "", - intent = "", - dataset = "", - } - }, - projectKind = "Conversation", - }, -}); -Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); -]]> - - - -This sample shows how to call TrainAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call TrainAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) -{ - TrainingConfigVersion = "", - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, -}; -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call Train. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); -Operation operation = client.Train(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call Train with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) -{ - TrainingConfigVersion = "", - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, -}; -Operation operation = client.Train(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call TrainAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingMode = "advanced", -}); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call TrainAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", - trainingMode = "advanced", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, -}); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call Train and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingMode = "advanced", -}); -Operation operation = client.Train(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call Train with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", - trainingMode = "advanced", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, -}); -Operation operation = client.Train(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call SwapDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call SwapDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call SwapDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); -]]> -This sample shows how to call SwapDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call SwapDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call SwapDeploymentsAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call SwapDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); -]]> -This sample shows how to call SwapDeployments with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call DeployProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails(""); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeployProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails("") -{ - AssignedResourceIds = { "" }, -}; -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeployProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails(""); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeployProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails("") -{ - AssignedResourceIds = { "" }, -}; -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeployProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeployProjectAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeployProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeployProject with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeleteDeploymentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteDeploymentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteDeployment. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteDeployment with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteDeploymentFromResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails(); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails -{ - AssignedResourceIds = { "" }, -}; -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeleteDeploymentFromResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails(); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeleteDeploymentFromResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails -{ - AssignedResourceIds = { "" }, -}; -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeleteDeploymentFromResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeleteDeploymentFromResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeleteDeploymentFromResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call EvaluateModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails(); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> -This sample shows how to call EvaluateModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails -{ - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, -}; -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call EvaluateModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails(); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> -This sample shows how to call EvaluateModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails -{ - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, -}; -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call EvaluateModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call EvaluateModelAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, -}); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call EvaluateModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call EvaluateModel with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, -}); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call LoadSnapshotAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call LoadSnapshotAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call LoadSnapshot. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call LoadSnapshot with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call AssignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call AssignDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call AssignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); -]]> -This sample shows how to call AssignDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call AssignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call AssignDeploymentResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call AssignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); -]]> -This sample shows how to call AssignDeploymentResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call UnassignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call UnassignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); -]]> -This sample shows how to call UnassignDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call UnassignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call UnassignDeploymentResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call UnassignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); -]]> -This sample shows how to call UnassignDeploymentResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call CancelTrainingJobAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call CancelTrainingJobAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call CancelTrainingJob. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call CancelTrainingJob with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call CancelTrainingJobAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call CancelTrainingJobAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call CancelTrainingJob and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call CancelTrainingJob with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingMode").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call DeleteExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call CreateOrUpdateExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call CreateOrUpdateExportedModel with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); -]]> - - - \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringCompositionMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringCompositionMode.cs new file mode 100644 index 000000000000..41438155cdcb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringCompositionMode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The AnalyzeConversationAuthoringCompositionMode. + public readonly partial struct AnalyzeConversationAuthoringCompositionMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AnalyzeConversationAuthoringCompositionMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReturnLongestOverlapValue = "returnLongestOverlap"; + private const string RequireExactOverlapValue = "requireExactOverlap"; + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// When two or more components are found in the text and overlap, the component with the longest set of characters is returned. + public static AnalyzeConversationAuthoringCompositionMode ReturnLongestOverlap { get; } = new AnalyzeConversationAuthoringCompositionMode(ReturnLongestOverlapValue); + /// All components must overlap at the exact same characters in the text for the entity to return. If one of the defined components is not matched or predicted, the entity will not return. + public static AnalyzeConversationAuthoringCompositionMode RequireExactOverlap { get; } = new AnalyzeConversationAuthoringCompositionMode(RequireExactOverlapValue); + /// Every component's match or prediction is returned as a separate instance of the entity. + public static AnalyzeConversationAuthoringCompositionMode SeparateComponents { get; } = new AnalyzeConversationAuthoringCompositionMode(SeparateComponentsValue); + /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. + public static AnalyzeConversationAuthoringCompositionMode CombineComponents { get; } = new AnalyzeConversationAuthoringCompositionMode(CombineComponentsValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyzeConversationAuthoringCompositionMode left, AnalyzeConversationAuthoringCompositionMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyzeConversationAuthoringCompositionMode left, AnalyzeConversationAuthoringCompositionMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AnalyzeConversationAuthoringCompositionMode(string value) => new AnalyzeConversationAuthoringCompositionMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyzeConversationAuthoringCompositionMode other && Equals(other); + /// + public bool Equals(AnalyzeConversationAuthoringCompositionMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.Serialization.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.Serialization.cs index cc2df8970195..9126030eee31 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeConversationAuthoringConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringConfusionMatrixCell)} does not support writing '{format}' format."); } writer.WritePropertyName("normalizedValue"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeConversationAuthoringConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringConfusionMatrixCell)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrixCell(document.RootElement, options); + return DeserializeAnalyzeConversationAuthoringConfusionMatrixCell(document.RootElement, options); } - internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeConversationAuthoringConfusionMatrixCell DeserializeAnalyzeConversationAuthoringConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); + return new AnalyzeConversationAuthoringConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringConfusionMatrixCell)} does not support writing '{options.Format}' format."); } } - ConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeConversationAuthoringConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrixCell(document.RootElement, options); + return DeserializeAnalyzeConversationAuthoringConfusionMatrixCell(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringConfusionMatrixCell)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ConfusionMatrixCell FromResponse(Response response) + internal static AnalyzeConversationAuthoringConfusionMatrixCell FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrixCell(document.RootElement); + return DeserializeAnalyzeConversationAuthoringConfusionMatrixCell(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.cs index f1d43695af13..173fd642910c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringConfusionMatrixCell.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents a cell in a confusion matrix. - public partial class ConfusionMatrixCell + public partial class AnalyzeConversationAuthoringConfusionMatrixCell { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ public partial class ConfusionMatrixCell /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. - internal ConfusionMatrixCell(float normalizedValue, float rawValue) + internal AnalyzeConversationAuthoringConfusionMatrixCell(float normalizedValue, float rawValue) { NormalizedValue = normalizedValue; RawValue = rawValue; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. /// Keeps track of any properties unknown to the library. - internal ConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) + internal AnalyzeConversationAuthoringConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) { NormalizedValue = normalizedValue; RawValue = rawValue; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ConfusionMatrixCell() + /// Initializes a new instance of for deserialization. + internal AnalyzeConversationAuthoringConfusionMatrixCell() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringEvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringEvaluationKind.cs new file mode 100644 index 000000000000..3d74c0a93415 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringEvaluationKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The AnalyzeConversationAuthoringEvaluationKind. + public readonly partial struct AnalyzeConversationAuthoringEvaluationKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AnalyzeConversationAuthoringEvaluationKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PercentageValue = "percentage"; + private const string ManualValue = "manual"; + + /// Split the data into training and test sets according to user-defined percentages. + public static AnalyzeConversationAuthoringEvaluationKind Percentage { get; } = new AnalyzeConversationAuthoringEvaluationKind(PercentageValue); + /// Split the data according to the chosen dataset for every example in the data. + public static AnalyzeConversationAuthoringEvaluationKind Manual { get; } = new AnalyzeConversationAuthoringEvaluationKind(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyzeConversationAuthoringEvaluationKind left, AnalyzeConversationAuthoringEvaluationKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyzeConversationAuthoringEvaluationKind left, AnalyzeConversationAuthoringEvaluationKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AnalyzeConversationAuthoringEvaluationKind(string value) => new AnalyzeConversationAuthoringEvaluationKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyzeConversationAuthoringEvaluationKind other && Equals(other); + /// + public bool Equals(AnalyzeConversationAuthoringEvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringExportedProjectFormat.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringExportedProjectFormat.cs new file mode 100644 index 000000000000..43d83bce80c7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringExportedProjectFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The AnalyzeConversationAuthoringExportedProjectFormat. + public readonly partial struct AnalyzeConversationAuthoringExportedProjectFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AnalyzeConversationAuthoringExportedProjectFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConversationValue = "Conversation"; + private const string LuisValue = "Luis"; + + /// Specifies the format for a conversational project. + public static AnalyzeConversationAuthoringExportedProjectFormat Conversation { get; } = new AnalyzeConversationAuthoringExportedProjectFormat(ConversationValue); + /// Specifies the format for an application that was exported from LUIS. + public static AnalyzeConversationAuthoringExportedProjectFormat Luis { get; } = new AnalyzeConversationAuthoringExportedProjectFormat(LuisValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyzeConversationAuthoringExportedProjectFormat left, AnalyzeConversationAuthoringExportedProjectFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyzeConversationAuthoringExportedProjectFormat left, AnalyzeConversationAuthoringExportedProjectFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AnalyzeConversationAuthoringExportedProjectFormat(string value) => new AnalyzeConversationAuthoringExportedProjectFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyzeConversationAuthoringExportedProjectFormat other && Equals(other); + /// + public bool Equals(AnalyzeConversationAuthoringExportedProjectFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectKind.cs new file mode 100644 index 000000000000..d63a1e50307b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The AnalyzeConversationAuthoringProjectKind. + public readonly partial struct AnalyzeConversationAuthoringProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AnalyzeConversationAuthoringProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConversationValue = "Conversation"; + private const string OrchestrationValue = "Orchestration"; + private const string CustomConversationSummarizationValue = "CustomConversationSummarization"; + + /// A project to build natural language into apps, bots, and IoT devices. + public static AnalyzeConversationAuthoringProjectKind Conversation { get; } = new AnalyzeConversationAuthoringProjectKind(ConversationValue); + /// A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project. + public static AnalyzeConversationAuthoringProjectKind Orchestration { get; } = new AnalyzeConversationAuthoringProjectKind(OrchestrationValue); + /// A project to build conversation summarization models which are able to summarize long conversations. + public static AnalyzeConversationAuthoringProjectKind CustomConversationSummarization { get; } = new AnalyzeConversationAuthoringProjectKind(CustomConversationSummarizationValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyzeConversationAuthoringProjectKind left, AnalyzeConversationAuthoringProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyzeConversationAuthoringProjectKind left, AnalyzeConversationAuthoringProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AnalyzeConversationAuthoringProjectKind(string value) => new AnalyzeConversationAuthoringProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyzeConversationAuthoringProjectKind other && Equals(other); + /// + public bool Equals(AnalyzeConversationAuthoringProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.Serialization.cs similarity index 60% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.Serialization.cs index 7104e28cc936..cc4e400ef376 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ProjectSettings : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeConversationAuthoringProjectSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringProjectSettings)} does not support writing '{format}' format."); } writer.WritePropertyName("confidenceThreshold"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeConversationAuthoringProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringProjectSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectSettings(document.RootElement, options); + return DeserializeAnalyzeConversationAuthoringProjectSettings(document.RootElement, options); } - internal static ProjectSettings DeserializeProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeConversationAuthoringProjectSettings DeserializeAnalyzeConversationAuthoringProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,46 +89,46 @@ internal static ProjectSettings DeserializeProjectSettings(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectSettings(confidenceThreshold, serializedAdditionalRawData); + return new AnalyzeConversationAuthoringProjectSettings(confidenceThreshold, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringProjectSettings)} does not support writing '{options.Format}' format."); } } - ProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeConversationAuthoringProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectSettings(document.RootElement, options); + return DeserializeAnalyzeConversationAuthoringProjectSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationAuthoringProjectSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectSettings FromResponse(Response response) + internal static AnalyzeConversationAuthoringProjectSettings FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectSettings(document.RootElement); + return DeserializeAnalyzeConversationAuthoringProjectSettings(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.cs similarity index 79% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.cs index 46ad35fa50c9..dcbf84ba389b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringProjectSettings.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the settings used to define the project behavior. - public partial class ProjectSettings + public partial class AnalyzeConversationAuthoringProjectSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,24 +45,24 @@ public partial class ProjectSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. - public ProjectSettings(float confidenceThreshold) + public AnalyzeConversationAuthoringProjectSettings(float confidenceThreshold) { ConfidenceThreshold = confidenceThreshold; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal ProjectSettings(float confidenceThreshold, IDictionary serializedAdditionalRawData) + internal AnalyzeConversationAuthoringProjectSettings(float confidenceThreshold, IDictionary serializedAdditionalRawData) { ConfidenceThreshold = confidenceThreshold; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectSettings() + /// Initializes a new instance of for deserialization. + internal AnalyzeConversationAuthoringProjectSettings() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringTrainingMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringTrainingMode.cs new file mode 100644 index 000000000000..2ecdb3bcd4f6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationAuthoringTrainingMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The AnalyzeConversationAuthoringTrainingMode. + public readonly partial struct AnalyzeConversationAuthoringTrainingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AnalyzeConversationAuthoringTrainingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdvancedValue = "advanced"; + private const string StandardValue = "standard"; + + /// Trains using fine-tuned neural network transformer models. Can train multilingual projects. + public static AnalyzeConversationAuthoringTrainingMode Advanced { get; } = new AnalyzeConversationAuthoringTrainingMode(AdvancedValue); + /// Faster training times for quicker iterations. + public static AnalyzeConversationAuthoringTrainingMode Standard { get; } = new AnalyzeConversationAuthoringTrainingMode(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyzeConversationAuthoringTrainingMode left, AnalyzeConversationAuthoringTrainingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyzeConversationAuthoringTrainingMode left, AnalyzeConversationAuthoringTrainingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AnalyzeConversationAuthoringTrainingMode(string value) => new AnalyzeConversationAuthoringTrainingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyzeConversationAuthoringTrainingMode other && Equals(other); + /// + public bool Equals(AnalyzeConversationAuthoringTrainingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.Serialization.cs similarity index 59% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.Serialization.cs index 05e9346b88b7..bc7aa56db46c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeConversationConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationConfusionMatrixRow)} does not support writing '{format}' format."); } foreach (var item in AdditionalProperties) @@ -48,19 +48,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeConversationConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationConfusionMatrixRow)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrixRow(document.RootElement, options); + return DeserializeAnalyzeConversationConfusionMatrixRow(document.RootElement, options); } - internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeConversationConfusionMatrixRow DeserializeAnalyzeConversationConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -75,46 +75,46 @@ internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement ele additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new ConfusionMatrixRow(additionalProperties); + return new AnalyzeConversationConfusionMatrixRow(additionalProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationConfusionMatrixRow)} does not support writing '{options.Format}' format."); } } - ConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeConversationConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrixRow(document.RootElement, options); + return DeserializeAnalyzeConversationConfusionMatrixRow(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeConversationConfusionMatrixRow)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ConfusionMatrixRow FromResponse(Response response) + internal static AnalyzeConversationConfusionMatrixRow FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrixRow(document.RootElement); + return DeserializeAnalyzeConversationConfusionMatrixRow(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.cs index f83b84299f2e..90a0deb3023a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AnalyzeConversationConfusionMatrixRow.cs @@ -10,18 +10,18 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - /// The ConfusionMatrixRow. - public partial class ConfusionMatrixRow + /// The AnalyzeConversationConfusionMatrixRow. + public partial class AnalyzeConversationConfusionMatrixRow { - /// Initializes a new instance of . - internal ConfusionMatrixRow() + /// Initializes a new instance of . + internal AnalyzeConversationConfusionMatrixRow() { AdditionalProperties = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Additional Properties. - internal ConfusionMatrixRow(IReadOnlyDictionary additionalProperties) + internal AnalyzeConversationConfusionMatrixRow(IReadOnlyDictionary additionalProperties) { AdditionalProperties = additionalProperties; } @@ -39,7 +39,7 @@ internal ConfusionMatrixRow(IReadOnlyDictionary additionalPr /// Supported types: /// /// - /// + /// /// /// /// diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs index 60bee30edf13..2edaf7a5ccfc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs @@ -36,7 +36,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resourcesMetadata"u8); writer.WriteStartArray(); - foreach (var item in ResourcesMetadata) + foreach (var item in Metadata) { writer.WriteObjectValue(item, options); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs index afaf75245625..db6ba4d810c3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs @@ -47,21 +47,21 @@ public partial class AssignDeploymentResourcesDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the metadata for the resources to be assigned. - /// is null. - public AssignDeploymentResourcesDetails(IEnumerable resourcesMetadata) + /// Represents the metadata for the resources to be assigned. + /// is null. + public AssignDeploymentResourcesDetails(IEnumerable metadata) { - Argument.AssertNotNull(resourcesMetadata, nameof(resourcesMetadata)); + Argument.AssertNotNull(metadata, nameof(metadata)); - ResourcesMetadata = resourcesMetadata.ToList(); + Metadata = metadata.ToList(); } /// Initializes a new instance of . - /// Represents the metadata for the resources to be assigned. + /// Represents the metadata for the resources to be assigned. /// Keeps track of any properties unknown to the library. - internal AssignDeploymentResourcesDetails(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + internal AssignDeploymentResourcesDetails(IList metadata, IDictionary serializedAdditionalRawData) { - ResourcesMetadata = resourcesMetadata; + Metadata = metadata; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -71,6 +71,6 @@ internal AssignDeploymentResourcesDetails() } /// Represents the metadata for the resources to be assigned. - public IList ResourcesMetadata { get; } + public IList Metadata { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs index 9f5ca609d99b..aecef86d2486 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs @@ -37,7 +37,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W") { writer.WritePropertyName("azureResourceId"u8); - writer.WriteStringValue(AzureResourceId); + writer.WriteStringValue(ResourceId); } writer.WritePropertyName("region"u8); writer.WriteStringValue(Region); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs index 618f6d01d66e..937823d307e8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs @@ -56,12 +56,12 @@ internal AssignedDeploymentResource(string region) } /// Initializes a new instance of . - /// The resource ID. + /// The resource ID. /// The resource region. /// Keeps track of any properties unknown to the library. - internal AssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) + internal AssignedDeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) { - AzureResourceId = azureResourceId; + ResourceId = resourceId; Region = region; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,7 +72,7 @@ internal AssignedDeploymentResource() } /// The resource ID. - public string AzureResourceId { get; } + public string ResourceId { get; } /// The resource region. public string Region { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs index 04c1e3d2fe12..dcc6f5c8eed9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs @@ -37,9 +37,9 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("deploymentName"u8); writer.WriteStringValue(DeploymentName); writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WriteStringValue(LastDeployedOn, "O"); writer.WritePropertyName("deploymentExpirationDate"u8); - writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WriteStringValue(DeploymentExpiresOn, "D"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs index fae2ecce4b15..494860290526 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs @@ -47,28 +47,28 @@ public partial class AssignedProjectDeploymentMetadata /// Initializes a new instance of . /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// is null. - internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate) + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiresOn) { Argument.AssertNotNull(deploymentName, nameof(deploymentName)); DeploymentName = deploymentName; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastDeployedOn = lastDeployedOn; + DeploymentExpiresOn = deploymentExpiresOn; } /// Initializes a new instance of . /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Keeps track of any properties unknown to the library. - internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, IDictionary serializedAdditionalRawData) + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiresOn, IDictionary serializedAdditionalRawData) { DeploymentName = deploymentName; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastDeployedOn = lastDeployedOn; + DeploymentExpiresOn = deploymentExpiresOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -80,8 +80,8 @@ internal AssignedProjectDeploymentMetadata() /// Represents the deployment name. public string DeploymentName { get; } /// Represents deployment last deployed time. - public DateTimeOffset LastDeployedDateTime { get; } + public DateTimeOffset LastDeployedOn { get; } /// Represents deployment expiration date in the runtime. - public DateTimeOffset DeploymentExpirationDate { get; } + public DateTimeOffset DeploymentExpiresOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs index 5b597fcb1be1..7559bd8c4d52 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); } - writer.WritePropertyName("projectName"u8); - writer.WriteStringValue(ProjectName); + if (options.Format != "W") + { + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + } writer.WritePropertyName("deploymentsMetadata"u8); writer.WriteStartArray(); foreach (var item in DeploymentsMetadata) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs index 9f66a10adc3a..8c1facc21855 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs @@ -47,15 +47,12 @@ public partial class AssignedProjectDeploymentsMetadata private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the project name. /// Represents the resource region. - /// or is null. - internal AssignedProjectDeploymentsMetadata(string projectName, IEnumerable deploymentsMetadata) + /// is null. + internal AssignedProjectDeploymentsMetadata(IEnumerable deploymentsMetadata) { - Argument.AssertNotNull(projectName, nameof(projectName)); Argument.AssertNotNull(deploymentsMetadata, nameof(deploymentsMetadata)); - ProjectName = projectName; DeploymentsMetadata = deploymentsMetadata.ToList(); } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs deleted file mode 100644 index abfd17b13326..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class AssignedResourceDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AssignedResourceDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); - } - - internal static AssignedResourceDeploymentsMetadata DeserializeAssignedResourceDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AssignedResourceDeploymentsMetadata(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support writing '{options.Format}' format."); - } - } - - AssignedResourceDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AssignedResourceDeploymentsMetadata FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs deleted file mode 100644 index 30cb10584f98..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Represents the metadata for deployments assigned to a resource. - public partial class AssignedResourceDeploymentsMetadata - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The list of retrieved assigned project deployments. - /// is null. - internal AssignedResourceDeploymentsMetadata(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The list of retrieved assigned project deployments. - /// The next page link. - /// Keeps track of any properties unknown to the library. - internal AssignedResourceDeploymentsMetadata(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AssignedResourceDeploymentsMetadata() - { - } - - /// The list of retrieved assigned project deployments. - public IReadOnlyList Value { get; } - /// The next page link. - public string NextLink { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs deleted file mode 100644 index e10a01cd735b..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class AuthoringConversationsError : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"u8); - writer.WriteStringValue(Target); - } - if (Optional.IsCollectionDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteStartArray(); - foreach (var item in Details) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Innererror)) - { - writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(Innererror, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AuthoringConversationsError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAuthoringConversationsError(document.RootElement, options); - } - - internal static AuthoringConversationsError DeserializeAuthoringConversationsError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ErrorCode code = default; - string message = default; - string target = default; - IReadOnlyList details = default; - InnerErrorModel innererror = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = new ErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeAuthoringConversationsError(item, options)); - } - details = array; - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AuthoringConversationsError( - code, - message, - target, - details ?? new ChangeTrackingList(), - innererror, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support writing '{options.Format}' format."); - } - } - - AuthoringConversationsError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAuthoringConversationsError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AuthoringConversationsError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAuthoringConversationsError(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs deleted file mode 100644 index ce1afc865676..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The error object. - public partial class AuthoringConversationsError - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// is null. - internal AuthoringConversationsError(ErrorCode code, string message) - { - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// - /// An object containing more specific information than the current object about - /// the error. - /// - /// Keeps track of any properties unknown to the library. - internal AuthoringConversationsError(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Target = target; - Details = details; - Innererror = innererror; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AuthoringConversationsError() - { - } - - /// One of a server-defined set of error codes. - public ErrorCode Code { get; } - /// A human-readable representation of the error. - public string Message { get; } - /// The target of the error. - public string Target { get; } - /// An array of details about specific errors that led to this reported error. - public IReadOnlyList Details { get; } - /// - /// An object containing more specific information than the current object about - /// the error. - /// - public InnerErrorModel Innererror { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs deleted file mode 100644 index 48ce205e2308..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class AuthoringConversationsWarning : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AuthoringConversationsWarning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAuthoringConversationsWarning(document.RootElement, options); - } - - internal static AuthoringConversationsWarning DeserializeAuthoringConversationsWarning(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AuthoringConversationsWarning(code, message, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support writing '{options.Format}' format."); - } - } - - AuthoringConversationsWarning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAuthoringConversationsWarning(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static AuthoringConversationsWarning FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAuthoringConversationsWarning(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs deleted file mode 100644 index d95d8f4f8f5c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Represents a warning that was encountered while executing the request. - public partial class AuthoringConversationsWarning - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// or is null. - internal AuthoringConversationsWarning(string code, string message) - { - Argument.AssertNotNull(code, nameof(code)); - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - } - - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// Keeps track of any properties unknown to the library. - internal AuthoringConversationsWarning(string code, string message, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AuthoringConversationsWarning() - { - } - - /// The warning code. - public string Code { get; } - /// The warning message. - public string Message { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs deleted file mode 100644 index b4be981ec617..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The CompositionSetting. - public readonly partial struct CompositionSetting : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CompositionSetting(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ReturnLongestOverlapValue = "returnLongestOverlap"; - private const string RequireExactOverlapValue = "requireExactOverlap"; - private const string SeparateComponentsValue = "separateComponents"; - private const string CombineComponentsValue = "combineComponents"; - - /// When two or more components are found in the text and overlap, the component with the longest set of characters is returned. - public static CompositionSetting ReturnLongestOverlap { get; } = new CompositionSetting(ReturnLongestOverlapValue); - /// All components must overlap at the exact same characters in the text for the entity to return. If one of the defined components is not matched or predicted, the entity will not return. - public static CompositionSetting RequireExactOverlap { get; } = new CompositionSetting(RequireExactOverlapValue); - /// Every component's match or prediction is returned as a separate instance of the entity. - public static CompositionSetting SeparateComponents { get; } = new CompositionSetting(SeparateComponentsValue); - /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. - public static CompositionSetting CombineComponents { get; } = new CompositionSetting(CombineComponentsValue); - /// Determines if two values are the same. - public static bool operator ==(CompositionSetting left, CompositionSetting right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CompositionSetting left, CompositionSetting right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CompositionSetting(string value) => new CompositionSetting(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CompositionSetting other && Equals(other); - /// - public bool Equals(CompositionSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs deleted file mode 100644 index 289628a1b94e..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class ConfusionMatrix : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{format}' format."); - } - - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - - ConfusionMatrix IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrix(document.RootElement, options); - } - - internal static ConfusionMatrix DeserializeConfusionMatrix(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new ConfusionMatrix(additionalProperties); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{options.Format}' format."); - } - } - - ConfusionMatrix IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrix(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ConfusionMatrix FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrix(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs deleted file mode 100644 index 0334a2da03b5..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The ConfusionMatrix. - public partial class ConfusionMatrix - { - /// Initializes a new instance of . - internal ConfusionMatrix() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Additional Properties. - internal ConfusionMatrix(IReadOnlyDictionary additionalProperties) - { - AdditionalProperties = additionalProperties; - } - - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// - /// Supported types: - /// - /// - /// - /// - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IReadOnlyDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationAuthoringOperationStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationAuthoringOperationStatus.cs new file mode 100644 index 000000000000..7112361cfc79 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationAuthoringOperationStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The ConversationAuthoringOperationStatus. + public readonly partial struct ConversationAuthoringOperationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConversationAuthoringOperationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CancelledValue = "cancelled"; + private const string CancellingValue = "cancelling"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static ConversationAuthoringOperationStatus NotStarted { get; } = new ConversationAuthoringOperationStatus(NotStartedValue); + /// running. + public static ConversationAuthoringOperationStatus Running { get; } = new ConversationAuthoringOperationStatus(RunningValue); + /// succeeded. + public static ConversationAuthoringOperationStatus Succeeded { get; } = new ConversationAuthoringOperationStatus(SucceededValue); + /// failed. + public static ConversationAuthoringOperationStatus Failed { get; } = new ConversationAuthoringOperationStatus(FailedValue); + /// cancelled. + public static ConversationAuthoringOperationStatus Cancelled { get; } = new ConversationAuthoringOperationStatus(CancelledValue); + /// cancelling. + public static ConversationAuthoringOperationStatus Cancelling { get; } = new ConversationAuthoringOperationStatus(CancellingValue); + /// partiallyCompleted. + public static ConversationAuthoringOperationStatus PartiallyCompleted { get; } = new ConversationAuthoringOperationStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(ConversationAuthoringOperationStatus left, ConversationAuthoringOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConversationAuthoringOperationStatus left, ConversationAuthoringOperationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConversationAuthoringOperationStatus(string value) => new ConversationAuthoringOperationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConversationAuthoringOperationStatus other && Equals(other); + /// + public bool Equals(ConversationAuthoringOperationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs index ffc9ece17b27..a905d7bbf3b9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs @@ -36,15 +36,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category); - if (Optional.IsDefined(CompositionSetting)) + if (Optional.IsDefined(CompositionMode)) { writer.WritePropertyName("compositionSetting"u8); - writer.WriteStringValue(CompositionSetting.Value.ToString()); + writer.WriteStringValue(CompositionMode.Value.ToString()); } - if (Optional.IsDefined(List)) + if (Optional.IsDefined(Entities)) { - writer.WritePropertyName("list"u8); - writer.WriteObjectValue(List, options); + writer.WritePropertyName("entities"u8); + writer.WriteObjectValue(Entities, options); } if (Optional.IsCollectionDefined(Prebuilts)) { @@ -109,8 +109,8 @@ internal static ConversationExportedEntity DeserializeConversationExportedEntity return null; } string category = default; - CompositionSetting? compositionSetting = default; - ExportedEntityList list = default; + AnalyzeConversationAuthoringCompositionMode? compositionSetting = default; + ExportedEntityList entities = default; IList prebuilts = default; ExportedEntityRegex regex = default; IList requiredComponents = default; @@ -129,16 +129,16 @@ internal static ConversationExportedEntity DeserializeConversationExportedEntity { continue; } - compositionSetting = new CompositionSetting(property.Value.GetString()); + compositionSetting = new AnalyzeConversationAuthoringCompositionMode(property.Value.GetString()); continue; } - if (property.NameEquals("list"u8)) + if (property.NameEquals("entities"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - list = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); + entities = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); continue; } if (property.NameEquals("prebuilts"u8)) @@ -187,7 +187,7 @@ internal static ConversationExportedEntity DeserializeConversationExportedEntity return new ConversationExportedEntity( category, compositionSetting, - list, + entities, prebuilts ?? new ChangeTrackingList(), regex, requiredComponents ?? new ChangeTrackingList(), diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs index 1c617fcdfbb1..d62bf4d550b9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs @@ -59,17 +59,17 @@ public ConversationExportedEntity(string category) /// Initializes a new instance of . /// The category of the entity. - /// The behavior to follow when the entity's components overlap with each other. - /// The list component of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. /// The prebuilt entities components. /// The regex component of the entity. /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. /// Keeps track of any properties unknown to the library. - internal ConversationExportedEntity(string category, CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, ExportedEntityRegex regex, IList requiredComponents, IDictionary serializedAdditionalRawData) + internal ConversationExportedEntity(string category, AnalyzeConversationAuthoringCompositionMode? compositionMode, ExportedEntityList entities, IList prebuilts, ExportedEntityRegex regex, IList requiredComponents, IDictionary serializedAdditionalRawData) { Category = category; - CompositionSetting = compositionSetting; - List = list; + CompositionMode = compositionMode; + Entities = entities; Prebuilts = prebuilts; Regex = regex; RequiredComponents = requiredComponents; @@ -84,9 +84,9 @@ internal ConversationExportedEntity() /// The category of the entity. public string Category { get; } /// The behavior to follow when the entity's components overlap with each other. - public CompositionSetting? CompositionSetting { get; set; } + public AnalyzeConversationAuthoringCompositionMode? CompositionMode { get; set; } /// The list component of the entity. - public ExportedEntityList List { get; set; } + public ExportedEntityList Entities { get; set; } /// The prebuilt entities components. public IList Prebuilts { get; } /// The regex component of the entity. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.Serialization.cs similarity index 73% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.Serialization.cs index ac8e5daf98a1..247b0c64416d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ConversationExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ConversationExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConversationExportedProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -67,19 +67,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ConversationExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConversationExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConversationExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConversationExportedProjectAssets(document.RootElement, options); + return DeserializeConversationExportedProjectAsset(document.RootElement, options); } - internal static ConversationExportedProjectAssets DeserializeConversationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConversationExportedProjectAsset DeserializeConversationExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -90,7 +90,7 @@ internal static ConversationExportedProjectAssets DeserializeConversationExporte IList intents = default; IList entities = default; IList utterances = default; - ProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -139,7 +139,7 @@ internal static ConversationExportedProjectAssets DeserializeConversationExporte } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -148,46 +148,46 @@ internal static ConversationExportedProjectAssets DeserializeConversationExporte } } serializedAdditionalRawData = rawDataDictionary; - return new ConversationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), entities ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); + return new ConversationExportedProjectAsset(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), entities ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConversationExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - ConversationExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConversationExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConversationExportedProjectAssets(document.RootElement, options); + return DeserializeConversationExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConversationExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ConversationExportedProjectAssets FromResponse(Response response) + internal static new ConversationExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeConversationExportedProjectAssets(document.RootElement); + return DeserializeConversationExportedProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.cs index 2691cb10e99d..f7076eb1699c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAsset.cs @@ -11,24 +11,24 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the exported assets of a conversational project. - public partial class ConversationExportedProjectAssets : ExportedProjectAssets + public partial class ConversationExportedProjectAsset : ExportedProjectAsset { - /// Initializes a new instance of . - public ConversationExportedProjectAssets() + /// Initializes a new instance of . + public ConversationExportedProjectAsset() { - ProjectKind = ProjectKind.Conversation; + ProjectKind = AnalyzeConversationAuthoringProjectKind.Conversation; Intents = new ChangeTrackingList(); Entities = new ChangeTrackingList(); Utterances = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The type of project containing the assets. /// Keeps track of any properties unknown to the library. /// The intents defined in the project. /// The entities defined in the project. /// The utterances defined in the project. - internal ConversationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList entities, IList utterances) : base(projectKind, serializedAdditionalRawData) + internal ConversationExportedProjectAsset(AnalyzeConversationAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList entities, IList utterances) : base(projectKind, serializedAdditionalRawData) { Intents = intents; Entities = entities; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs index 68b49a371f93..cfdb01a4437c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Dataset)) { writer.WritePropertyName("dataset"u8); - writer.WriteStringValue(Dataset); + writer.WriteStringValue(Dataset.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -99,7 +99,7 @@ internal static ConversationExportedUtterance DeserializeConversationExportedUtt string text = default; string language = default; string intent = default; - string dataset = default; + DatasetType? dataset = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -135,7 +135,11 @@ internal static ConversationExportedUtterance DeserializeConversationExportedUtt } if (property.NameEquals("dataset"u8)) { - dataset = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataset = new DatasetType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs index 7816b840ba05..b3a34767c90e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs @@ -66,7 +66,7 @@ public ConversationExportedUtterance(string text, string intent) /// The intent of the utterance. /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. /// Keeps track of any properties unknown to the library. - internal ConversationExportedUtterance(IList entities, string text, string language, string intent, string dataset, IDictionary serializedAdditionalRawData) + internal ConversationExportedUtterance(IList entities, string text, string language, string intent, DatasetType? dataset, IDictionary serializedAdditionalRawData) { Entities = entities; Text = text; @@ -90,6 +90,6 @@ internal ConversationExportedUtterance() /// The intent of the utterance. public string Intent { get; } /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. - public string Dataset { get; set; } + public DatasetType? Dataset { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs index 3267d337db0d..4adbe127a0ae 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs @@ -83,7 +83,7 @@ internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizat { return null; } - ProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; string storageInputContainerName = default; bool? allowOverwrite = default; IDictionary serializedAdditionalRawData = default; @@ -92,7 +92,7 @@ internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizat { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("storageInputContainerName"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs index e09ac95e521e..ab90cb77afbe 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -47,7 +47,7 @@ internal partial class CopyProjectAuthorizationRequest /// Initializes a new instance of . /// Represents the project kind. - internal CopyProjectAuthorizationRequest(ProjectKind projectKind) + internal CopyProjectAuthorizationRequest(AnalyzeConversationAuthoringProjectKind projectKind) { ProjectKind = projectKind; } @@ -57,7 +57,7 @@ internal CopyProjectAuthorizationRequest(ProjectKind projectKind) /// The name of the storage container. /// Whether to allow an existing project to be overwritten using the resulting copy authorization. /// Keeps track of any properties unknown to the library. - internal CopyProjectAuthorizationRequest(ProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + internal CopyProjectAuthorizationRequest(AnalyzeConversationAuthoringProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; StorageInputContainerName = storageInputContainerName; @@ -71,7 +71,7 @@ internal CopyProjectAuthorizationRequest() } /// Represents the project kind. - public ProjectKind ProjectKind { get; } + public AnalyzeConversationAuthoringProjectKind ProjectKind { get; } /// The name of the storage container. public string StorageInputContainerName { get; } /// Whether to allow an existing project to be overwritten using the resulting copy authorization. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs index 079609f4bae5..42a4ff30859b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs @@ -83,7 +83,7 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele { return null; } - ProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; string targetProjectName = default; string accessToken = default; DateTimeOffset expiresAt = default; @@ -95,7 +95,7 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("targetProjectName"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs index 8d0bc4bd02b4..862fbd79a3c8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs @@ -53,7 +53,7 @@ public partial class CopyProjectDetails /// Represents the target Azure resource ID. /// Represents the target Azure resource region. /// , , or is null. - public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) + public CopyProjectDetails(AnalyzeConversationAuthoringProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { Argument.AssertNotNull(targetProjectName, nameof(targetProjectName)); Argument.AssertNotNull(accessToken, nameof(accessToken)); @@ -76,7 +76,7 @@ public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, str /// Represents the target Azure resource ID. /// Represents the target Azure resource region. /// Keeps track of any properties unknown to the library. - internal CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) + internal CopyProjectDetails(AnalyzeConversationAuthoringProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; TargetProjectName = targetProjectName; @@ -93,7 +93,7 @@ internal CopyProjectDetails() } /// Represents the project kind. - public ProjectKind ProjectKind { get; set; } + public AnalyzeConversationAuthoringProjectKind ProjectKind { get; set; } /// The project name to be copied-into. public string TargetProjectName { get; set; } /// The access token. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.Serialization.cs index 351975e9b155..7981485e3728 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class CopyProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class CopyProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(CopyProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CopyProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CopyProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(CopyProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCopyProjectJobState(document.RootElement, options); + return DeserializeCopyProjectOperationState(document.RootElement, options); } - internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static CopyProjectOperationState DeserializeCopyProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new CopyProjectJobState( + return new CopyProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(CopyProjectOperationState)} does not support writing '{options.Format}' format."); } } - CopyProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + CopyProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCopyProjectJobState(document.RootElement, options); + return DeserializeCopyProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(CopyProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CopyProjectJobState FromResponse(Response response) + internal static CopyProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCopyProjectJobState(document.RootElement); + return DeserializeCopyProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.cs index affeb356c89a..c716ffda730e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a copy job. - public partial class CopyProjectJobState + public partial class CopyProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class CopyProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal CopyProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal CopyProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal CopyProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal CopyProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CopyProjectJobState() + /// Initializes a new instance of for deserialization. + internal CopyProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs index 5d8062fd3505..d78bea1e2a7f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs @@ -97,8 +97,8 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { return null; } - ProjectKind projectKind = default; - ProjectSettings settings = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectSettings settings = default; string storageInputContainerName = default; string projectName = default; bool? multilingual = default; @@ -110,7 +110,7 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("settings"u8)) @@ -119,7 +119,7 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { continue; } - settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + settings = AnalyzeConversationAuthoringProjectSettings.DeserializeAnalyzeConversationAuthoringProjectSettings(property.Value, options); continue; } if (property.NameEquals("storageInputContainerName"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs index 3d21a556966e..4de9b9888466 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs @@ -50,7 +50,7 @@ public partial class CreateProjectDetails /// The new project name. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// or is null. - public CreateProjectDetails(ProjectKind projectKind, string projectName, string language) + public CreateProjectDetails(AnalyzeConversationAuthoringProjectKind projectKind, string projectName, string language) { Argument.AssertNotNull(projectName, nameof(projectName)); Argument.AssertNotNull(language, nameof(language)); @@ -69,7 +69,7 @@ public CreateProjectDetails(ProjectKind projectKind, string projectName, string /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal CreateProjectDetails(ProjectKind projectKind, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal CreateProjectDetails(AnalyzeConversationAuthoringProjectKind projectKind, AnalyzeConversationAuthoringProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; Settings = settings; @@ -87,9 +87,9 @@ internal CreateProjectDetails() } /// Represents the project kind. - public ProjectKind ProjectKind { get; } + public AnalyzeConversationAuthoringProjectKind ProjectKind { get; } /// The project settings. - public ProjectSettings Settings { get; set; } + public AnalyzeConversationAuthoringProjectSettings Settings { get; set; } /// The storage container name in case of conversation summarization. public string StorageInputContainerName { get; set; } /// The new project name. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DatasetType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DatasetType.cs new file mode 100644 index 000000000000..a0e69c76f519 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DatasetType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + public readonly partial struct DatasetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatasetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrainValue = "Train"; + private const string TestValue = "Test"; + + /// Split the data into training and test sets according to user-defined percentages. + public static DatasetType Train { get; } = new DatasetType(TrainValue); + /// Split the data according to the chosen dataset for every example in the data. + public static DatasetType Test { get; } = new DatasetType(TestValue); + /// Determines if two values are the same. + public static bool operator ==(DatasetType left, DatasetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatasetType left, DatasetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatasetType(string value) => new DatasetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatasetType other && Equals(other); + /// + public bool Equals(DatasetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.Serialization.cs new file mode 100644 index 000000000000..87b099b02a9f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeploymentDeleteFromResourcesOperationState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesOperationState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedOn, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentDeleteFromResourcesOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesOperationState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentDeleteFromResourcesOperationState(document.RootElement, options); + } + + internal static DeploymentDeleteFromResourcesOperationState DeserializeDeploymentDeleteFromResourcesOperationState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentDeleteFromResourcesOperationState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesOperationState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentDeleteFromResourcesOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentDeleteFromResourcesOperationState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesOperationState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentDeleteFromResourcesOperationState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentDeleteFromResourcesOperationState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.cs index 4e1ee9ed2c1c..65f2d903d0b5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of an existing delete deployment from specific resources job. - public partial class DeploymentDeleteFromResourcesJobState + public partial class DeploymentDeleteFromResourcesOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class DeploymentDeleteFromResourcesJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal DeploymentDeleteFromResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal DeploymentDeleteFromResourcesOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal DeploymentDeleteFromResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal DeploymentDeleteFromResourcesOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentDeleteFromResourcesJobState() + /// Initializes a new instance of for deserialization. + internal DeploymentDeleteFromResourcesOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.Serialization.cs index bc975cd541a8..37eda7b4d8b8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class DeploymentJobState : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentJobState(document.RootElement, options); + return DeserializeDeploymentOperationState(document.RootElement, options); } - internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentOperationState DeserializeDeploymentOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentJobState( + return new DeploymentOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentOperationState)} does not support writing '{options.Format}' format."); } } - DeploymentJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentJobState(document.RootElement, options); + return DeserializeDeploymentOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentJobState FromResponse(Response response) + internal static DeploymentOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentJobState(document.RootElement); + return DeserializeDeploymentOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.cs index 3b027b6d8460..5b928b73d7fb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a deployment job. - public partial class DeploymentJobState + public partial class DeploymentOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class DeploymentJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal DeploymentJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal DeploymentOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal DeploymentJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal DeploymentOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentJobState() + /// Initializes a new instance of for deserialization. + internal DeploymentOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.Serialization.cs similarity index 71% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.Serialization.cs index bda18efe99e8..f8b03f9cc669 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.AI.Language.Text.Authoring.Models +namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class AssignDeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentResourcesOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentResourcesOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssignDeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentResourcesOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentResourcesOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignDeploymentResourcesJobState(document.RootElement, options); + return DeserializeDeploymentResourcesOperationState(document.RootElement, options); } - internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentResourcesOperationState DeserializeDeploymentResourcesOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentRes DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentRes } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentRes { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentRes { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentRes } } serializedAdditionalRawData = rawDataDictionary; - return new AssignDeploymentResourcesJobState( + return new DeploymentResourcesOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentResourcesOperationState)} does not support writing '{options.Format}' format."); } } - AssignDeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentResourcesOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignDeploymentResourcesJobState(document.RootElement, options); + return DeserializeDeploymentResourcesOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentResourcesOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AssignDeploymentResourcesJobState FromResponse(Response response) + internal static DeploymentResourcesOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignDeploymentResourcesJobState(document.RootElement); + return DeserializeDeploymentResourcesOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.cs index 1448217b4dbd..99dcb15d0e01 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a deployment resources job. - public partial class DeploymentResourcesJobState + public partial class DeploymentResourcesOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class DeploymentResourcesJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal DeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal DeploymentResourcesOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal DeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal DeploymentResourcesOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentResourcesJobState() + /// Initializes a new instance of for deserialization. + internal DeploymentResourcesOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs index c47755962689..48722ae7d417 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs @@ -35,7 +35,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("confusionMatrix"u8); - writer.WriteObjectValue(ConfusionMatrix, options); + writer.WriteStartObject(); + foreach (var item in ConfusionMatrix) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); writer.WritePropertyName("entities"u8); writer.WriteStartObject(); foreach (var item in Entities) @@ -93,7 +99,7 @@ internal static EntitiesEvaluationSummary DeserializeEntitiesEvaluationSummary(J { return null; } - ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary confusionMatrix = default; IReadOnlyDictionary entities = default; float microF1 = default; float microPrecision = default; @@ -107,7 +113,12 @@ internal static EntitiesEvaluationSummary DeserializeEntitiesEvaluationSummary(J { if (property.NameEquals("confusionMatrix"u8)) { - confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AnalyzeConversationConfusionMatrixRow.DeserializeAnalyzeConversationConfusionMatrixRow(property0.Value, options)); + } + confusionMatrix = dictionary; continue; } if (property.NameEquals("entities"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs index 1ba5c2a42ed7..abcdd42d4bee 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs @@ -55,7 +55,7 @@ public partial class EntitiesEvaluationSummary /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// or is null. - internal EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + internal EntitiesEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) { Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); Argument.AssertNotNull(entities, nameof(entities)); @@ -80,7 +80,7 @@ internal EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDic /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + internal EntitiesEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) { ConfusionMatrix = confusionMatrix; Entities = entities; @@ -99,7 +99,7 @@ internal EntitiesEvaluationSummary() } /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. - public ConfusionMatrix ConfusionMatrix { get; } + public IReadOnlyDictionary ConfusionMatrix { get; } /// Represents the entities evaluation summary. public IReadOnlyDictionary Entities { get; } /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs index 131743f41f7b..3b208c7b2078 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs @@ -46,9 +46,9 @@ public partial class EntityEvaluationSummary private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the model precision. - /// Represents the model recall. - /// Represents the model F1 score. + /// Represents the model F1 score. + /// Represents the model precision. + /// Represents the model precision. /// Represents the count of true positive. /// Represents the count of true negative. /// Represents the count of false positive. @@ -65,9 +65,9 @@ internal EntityEvaluationSummary(double f1, double precision, double recall, int } /// Initializes a new instance of . - /// Represents the model precision. - /// Represents the model recall. - /// Represents the model F1 score. + /// Represents the model F1 score. + /// Represents the model precision. + /// Represents the model precision. /// Represents the count of true positive. /// Represents the count of true negative. /// Represents the count of false positive. @@ -90,11 +90,11 @@ internal EntityEvaluationSummary() { } - /// Represents the model precision. + /// Represents the model F1 score. public double F1 { get; } - /// Represents the model recall. + /// Represents the model precision. public double Precision { get; } - /// Represents the model F1 score. + /// Represents the model precision. public double Recall { get; } /// Represents the count of true positive. public int TruePositiveCount { get; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs deleted file mode 100644 index 977595b99c5f..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Human-readable error code. - public readonly partial struct ErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidRequestValue = "InvalidRequest"; - private const string InvalidArgumentValue = "InvalidArgument"; - private const string UnauthorizedValue = "Unauthorized"; - private const string ForbiddenValue = "Forbidden"; - private const string NotFoundValue = "NotFound"; - private const string ProjectNotFoundValue = "ProjectNotFound"; - private const string OperationNotFoundValue = "OperationNotFound"; - private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; - private const string AzureCognitiveSearchIndexNotFoundValue = "AzureCognitiveSearchIndexNotFound"; - private const string TooManyRequestsValue = "TooManyRequests"; - private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; - private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached"; - private const string InternalServerErrorValue = "InternalServerError"; - private const string ServiceUnavailableValue = "ServiceUnavailable"; - private const string TimeoutValue = "Timeout"; - private const string QuotaExceededValue = "QuotaExceeded"; - private const string ConflictValue = "Conflict"; - private const string WarningValue = "Warning"; - - /// InvalidRequest. - public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue); - /// InvalidArgument. - public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue); - /// Unauthorized. - public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue); - /// Forbidden. - public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue); - /// NotFound. - public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue); - /// ProjectNotFound. - public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue); - /// OperationNotFound. - public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue); - /// AzureCognitiveSearchNotFound. - public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue); - /// AzureCognitiveSearchIndexNotFound. - public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue); - /// TooManyRequests. - public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue); - /// AzureCognitiveSearchThrottling. - public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue); - /// AzureCognitiveSearchIndexLimitReached. - public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue); - /// InternalServerError. - public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue); - /// ServiceUnavailable. - public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue); - /// Timeout. - public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue); - /// QuotaExceeded. - public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue); - /// Conflict. - public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue); - /// Warning. - public static ErrorCode Warning { get; } = new ErrorCode(WarningValue); - /// Determines if two values are the same. - public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ErrorCode left, ErrorCode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ErrorCode(string value) => new ErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ErrorCode other && Equals(other); - /// - public bool Equals(ErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs index 2a72e648962b..c05e8ca54a40 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs @@ -86,7 +86,7 @@ internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement eleme { return null; } - EvaluationKind? kind = default; + AnalyzeConversationAuthoringEvaluationKind? kind = default; int? trainingSplitPercentage = default; int? testingSplitPercentage = default; IDictionary serializedAdditionalRawData = default; @@ -99,7 +99,7 @@ internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement eleme { continue; } - kind = new EvaluationKind(property.Value.GetString()); + kind = new AnalyzeConversationAuthoringEvaluationKind(property.Value.GetString()); continue; } if (property.NameEquals("trainingSplitPercentage"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs index c843e5d23f9b..97bbced16746 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs @@ -55,7 +55,7 @@ public EvaluationDetails() /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. /// Keeps track of any properties unknown to the library. - internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) + internal EvaluationDetails(AnalyzeConversationAuthoringEvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) { Kind = kind; TrainingSplitPercentage = trainingSplitPercentage; @@ -64,7 +64,7 @@ internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, i } /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. - public EvaluationKind? Kind { get; set; } + public AnalyzeConversationAuthoringEvaluationKind? Kind { get; set; } /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. public int? TrainingSplitPercentage { get; set; } /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs index a42d020c0f60..77f0477cef1d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("evaluationOptions"u8); - writer.WriteObjectValue(EvaluationOptions, options); + writer.WriteObjectValue(EvaluationDetails, options); writer.WritePropertyName("modelLabel"u8); writer.WriteStringValue(ModelLabel); writer.WritePropertyName("trainingConfigVersion"u8); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs index 66c98233abbd..04a4e22891d8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs @@ -46,32 +46,32 @@ public partial class EvaluationJobResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the options used running the evaluation. + /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. - /// , or is null. - internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) + /// , or is null. + internal EvaluationJobResult(EvaluationDetails evaluationDetails, string modelLabel, string trainingConfigVersion, int percentComplete) { - Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(evaluationDetails, nameof(evaluationDetails)); Argument.AssertNotNull(modelLabel, nameof(modelLabel)); Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); - EvaluationOptions = evaluationOptions; + EvaluationDetails = evaluationDetails; ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; PercentComplete = percentComplete; } /// Initializes a new instance of . - /// Represents the options used running the evaluation. + /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. /// Keeps track of any properties unknown to the library. - internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) + internal EvaluationJobResult(EvaluationDetails evaluationDetails, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) { - EvaluationOptions = evaluationOptions; + EvaluationDetails = evaluationDetails; ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; PercentComplete = percentComplete; @@ -84,7 +84,7 @@ internal EvaluationJobResult() } /// Represents the options used running the evaluation. - public EvaluationDetails EvaluationOptions { get; } + public EvaluationDetails EvaluationDetails { get; } /// Represents trained model label. public string ModelLabel { get; } /// Represents training config version. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs deleted file mode 100644 index 9b1349bc8470..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The EvaluationKind. - public readonly partial struct EvaluationKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EvaluationKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PercentageValue = "percentage"; - private const string ManualValue = "manual"; - - /// Split the data into training and test sets according to user-defined percentages. - public static EvaluationKind Percentage { get; } = new EvaluationKind(PercentageValue); - /// Split the data according to the chosen dataset for every example in the data. - public static EvaluationKind Manual { get; } = new EvaluationKind(ManualValue); - /// Determines if two values are the same. - public static bool operator ==(EvaluationKind left, EvaluationKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EvaluationKind left, EvaluationKind right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EvaluationKind(string value) => new EvaluationKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EvaluationKind other && Equals(other); - /// - public bool Equals(EvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.Serialization.cs similarity index 71% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.Serialization.cs index 724796e50c91..7c6d950acc0d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class EvaluationJobState : IUtf8JsonSerializable, IJsonModel + public partial class EvaluationOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EvaluationOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -89,19 +89,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EvaluationJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EvaluationOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EvaluationOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationJobState(document.RootElement, options); + return DeserializeEvaluationOperationState(document.RootElement, options); } - internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static EvaluationOperationState DeserializeEvaluationOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -113,9 +113,9 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; EvaluationJobResult result = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -147,7 +147,7 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -156,10 +156,10 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -170,10 +170,10 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -189,55 +189,55 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new EvaluationJobState( + return new EvaluationOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), result, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EvaluationOperationState)} does not support writing '{options.Format}' format."); } } - EvaluationJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EvaluationOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationJobState(document.RootElement, options); + return DeserializeEvaluationOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EvaluationOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EvaluationJobState FromResponse(Response response) + internal static EvaluationOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEvaluationJobState(document.RootElement); + return DeserializeEvaluationOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.cs index fba4e55b822e..6f6a5cd647b1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a evaluation job. - public partial class EvaluationJobState + public partial class EvaluationOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,40 +45,40 @@ public partial class EvaluationJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. /// Represents evaluation task detailed result. /// is null. - internal EvaluationJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, EvaluationJobResult result) + internal EvaluationOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status, EvaluationJobResult result) { Argument.AssertNotNull(result, nameof(result)); - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); Result = result; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents evaluation task detailed result. /// Keeps track of any properties unknown to the library. - internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) + internal EvaluationOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; @@ -86,25 +86,25 @@ internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTi _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EvaluationJobState() + /// Initializes a new instance of for deserialization. + internal EvaluationOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Represents evaluation task detailed result. public EvaluationJobResult Result { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.Serialization.cs index 954191e78e64..460d4f0d4ecf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ExportProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class ExportProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,14 +66,14 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } - if (Optional.IsDefined(ResultUrl)) + if (Optional.IsDefined(ResultUri)) { writer.WritePropertyName("resultUrl"u8); - writer.WriteStringValue(ResultUrl); + writer.WriteStringValue(ResultUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -92,19 +92,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportProjectJobState(document.RootElement, options); + return DeserializeExportProjectOperationState(document.RootElement, options); } - internal static ExportProjectJobState DeserializeExportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportProjectOperationState DeserializeExportProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -116,9 +116,9 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; string resultUrl = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -150,7 +150,7 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -159,10 +159,10 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -173,10 +173,10 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -192,55 +192,55 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ExportProjectJobState( + return new ExportProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), resultUrl, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportProjectOperationState)} does not support writing '{options.Format}' format."); } } - ExportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportProjectJobState(document.RootElement, options); + return DeserializeExportProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportProjectJobState FromResponse(Response response) + internal static ExportProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportProjectJobState(document.RootElement); + return DeserializeExportProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.cs index 3ba56b46d8d9..4a9374f458c3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of an export job. - public partial class ExportProjectJobState + public partial class ExportProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,62 +45,62 @@ public partial class ExportProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ExportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal ExportProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// The URL to use in order to download the exported project. + /// The URL to use in order to download the exported project. /// Keeps track of any properties unknown to the library. - internal ExportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) + internal ExportProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUri, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; - ResultUrl = resultUrl; + ResultUri = resultUri; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportProjectJobState() + /// Initializes a new instance of for deserialization. + internal ExportProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// The URL to use in order to download the exported project. - public string ResultUrl { get; } + public string ResultUri { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs deleted file mode 100644 index 2d5ee327c04c..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class ExportedModelJobState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{format}' format."); - } - - if (options.Format != "W") - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); - writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) - { - writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); - } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - if (Optional.IsCollectionDefined(Warnings)) - { - writer.WritePropertyName("warnings"u8); - writer.WriteStartArray(); - foreach (var item in Warnings) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Errors)) - { - writer.WritePropertyName("errors"u8); - writer.WriteStartArray(); - foreach (var item in Errors) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ExportedModelJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedModelJobState(document.RootElement, options); - } - - internal static ExportedModelJobState DeserializeExportedModelJobState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobId = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new JobStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("warnings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); - } - warnings = array; - continue; - } - if (property.NameEquals("errors"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); - } - errors = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ExportedModelJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{options.Format}' format."); - } - } - - ExportedModelJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedModelJobState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ExportedModelJobState FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedModelJobState(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.Serialization.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.Serialization.cs index c868942c403f..02ca890bee6f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class DeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + public partial class ExportedModelOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedModelOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedModelOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedModelOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentResourcesJobState(document.RootElement, options); + return DeserializeExportedModelOperationState(document.RootElement, options); } - internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedModelOperationState DeserializeExportedModelOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobSta DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobSta } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobSta { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobSta { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobSta } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentResourcesJobState( + return new ExportedModelOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedModelOperationState)} does not support writing '{options.Format}' format."); } } - DeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedModelOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentResourcesJobState(document.RootElement, options); + return DeserializeExportedModelOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedModelOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentResourcesJobState FromResponse(Response response) + internal static ExportedModelOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentResourcesJobState(document.RootElement); + return DeserializeExportedModelOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.cs index 639c21edbf42..62b3628da129 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a job to create or updated an exported model. - public partial class ExportedModelJobState + public partial class ExportedModelOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ExportedModelJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ExportedModelJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal ExportedModelOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ExportedModelJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal ExportedModelOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedModelJobState() + /// Initializes a new instance of for deserialization. + internal ExportedModelOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs index c27bdef7d60f..571b085dbd0e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs @@ -85,7 +85,7 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, string projectFileVersion = default; StringIndexType stringIndexType = default; CreateProjectDetails metadata = default; - ExportedProjectAssets assets = default; + ExportedProjectAsset assets = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -111,7 +111,7 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, { continue; } - assets = ExportedProjectAssets.DeserializeExportedProjectAssets(property.Value, options); + assets = ExportedProjectAsset.DeserializeExportedProjectAsset(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs index 75bdf301aa5e..fe001c28b4c7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs @@ -66,11 +66,11 @@ public ExportedProject(string projectFileVersion, StringIndexType stringIndexTyp /// Represents the project metadata. /// /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// /// Keeps track of any properties unknown to the library. - internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata, ExportedProjectAssets assets, IDictionary serializedAdditionalRawData) + internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata, ExportedProjectAsset assets, IDictionary serializedAdditionalRawData) { ProjectFileVersion = projectFileVersion; StringIndexType = stringIndexType; @@ -92,9 +92,9 @@ internal ExportedProject() public CreateProjectDetails Metadata { get; } /// /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public ExportedProjectAssets Assets { get; set; } + public ExportedProjectAsset Assets { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.Serialization.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.Serialization.cs index 6fe2e7b2ffc0..a7fa5a4666e5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - [PersistableModelProxy(typeof(UnknownExportedProjectAssets))] - public partial class ExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownExportedProjectAsset))] + public partial class ExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeExportedProjectAsset(document.RootElement, options); } - internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedProjectAsset DeserializeExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,50 +77,50 @@ internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonEleme { switch (discriminator.GetString()) { - case "Conversation": return ConversationExportedProjectAssets.DeserializeConversationExportedProjectAssets(element, options); - case "Orchestration": return OrchestrationExportedProjectAssets.DeserializeOrchestrationExportedProjectAssets(element, options); + case "Conversation": return ConversationExportedProjectAsset.DeserializeConversationExportedProjectAsset(element, options); + case "Orchestration": return OrchestrationExportedProjectAsset.DeserializeOrchestrationExportedProjectAsset(element, options); } } - return UnknownExportedProjectAssets.DeserializeUnknownExportedProjectAssets(element, options); + return UnknownExportedProjectAsset.DeserializeUnknownExportedProjectAsset(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedProjectAssets FromResponse(Response response) + internal static ExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedProjectAssets(document.RootElement); + return DeserializeExportedProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.cs index c039092126af..935011cbadde 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAsset.cs @@ -12,10 +12,10 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// /// Represents the assets of an exported project. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public abstract partial class ExportedProjectAssets + public abstract partial class ExportedProjectAsset { /// /// Keeps track of any properties unknown to the library. @@ -49,21 +49,21 @@ public abstract partial class ExportedProjectAssets /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected ExportedProjectAssets() + /// Initializes a new instance of . + protected ExportedProjectAsset() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The type of project containing the assets. /// Keeps track of any properties unknown to the library. - internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + internal ExportedProjectAsset(AnalyzeConversationAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The type of project containing the assets. - internal ProjectKind ProjectKind { get; set; } + internal AnalyzeConversationAuthoringProjectKind ProjectKind { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs deleted file mode 100644 index 2792adaccde8..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The ExportedProjectFormat. - public readonly partial struct ExportedProjectFormat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ExportedProjectFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ConversationValue = "Conversation"; - private const string LuisValue = "Luis"; - - /// Specifies the format for a conversational project. - public static ExportedProjectFormat Conversation { get; } = new ExportedProjectFormat(ConversationValue); - /// Specifies the format for an application that was exported from LUIS. - public static ExportedProjectFormat Luis { get; } = new ExportedProjectFormat(LuisValue); - /// Determines if two values are the same. - public static bool operator ==(ExportedProjectFormat left, ExportedProjectFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ExportedProjectFormat left, ExportedProjectFormat right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ExportedProjectFormat(string value) => new ExportedProjectFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ExportedProjectFormat other && Equals(other); - /// - public bool Equals(ExportedProjectFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs index bde241606e97..5c5da77c38ee 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastExportedModelDateTime"u8); - writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WriteStringValue(LastExportedModelOn, "O"); writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); if (options.Format != "W" && _serializedAdditionalRawData != null) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs index 6f4b7d525f73..799e21a9fcbf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs @@ -47,38 +47,38 @@ public partial class ExportedTrainedModel /// Initializes a new instance of . /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. /// The model training config version. /// or is null. - internal ExportedTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + internal ExportedTrainedModel(string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastExportedModelOn, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastExportedModelDateTime = lastExportedModelDateTime; - ModelExpirationDate = modelExpirationDate; + LastTrainedOn = lastTrainedOn; + LastExportedModelOn = lastExportedModelOn; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; } /// Initializes a new instance of . /// The exported model name. /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. /// The model training config version. /// Keeps track of any properties unknown to the library. - internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastExportedModelOn, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) { ExportedModelName = exportedModelName; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastExportedModelDateTime = lastExportedModelDateTime; - ModelExpirationDate = modelExpirationDate; + LastTrainedOn = lastTrainedOn; + LastExportedModelOn = lastExportedModelOn; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -93,11 +93,11 @@ internal ExportedTrainedModel() /// The model ID. public string ModelId { get; } /// The last trained date time of the model. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// The last exported date time of the model. - public DateTimeOffset LastExportedModelDateTime { get; } + public DateTimeOffset LastExportedModelOn { get; } /// The model expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } /// The model training config version. public string ModelTrainingConfigVersion { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.Serialization.cs index 3374f0e5bb6c..88186b124967 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ImportProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class ImportProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ImportProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ImportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ImportProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ImportProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeImportProjectJobState(document.RootElement, options); + return DeserializeImportProjectOperationState(document.RootElement, options); } - internal static ImportProjectJobState DeserializeImportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static ImportProjectOperationState DeserializeImportProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ImportProjectJobState( + return new ImportProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ImportProjectOperationState)} does not support writing '{options.Format}' format."); } } - ImportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ImportProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeImportProjectJobState(document.RootElement, options); + return DeserializeImportProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ImportProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ImportProjectJobState FromResponse(Response response) + internal static ImportProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeImportProjectJobState(document.RootElement); + return DeserializeImportProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.cs index 99a71bdd2853..2aac43ba14a8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of an import job. - public partial class ImportProjectJobState + public partial class ImportProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ImportProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ImportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal ImportProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ImportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal ImportProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ImportProjectJobState() + /// Initializes a new instance of for deserialization. + internal ImportProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs deleted file mode 100644 index 8fec0f3a7d94..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Human-readable error code. - public readonly partial struct InnerErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InnerErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidRequestValue = "InvalidRequest"; - private const string InvalidParameterValueValue = "InvalidParameterValue"; - private const string KnowledgeBaseNotFoundValue = "KnowledgeBaseNotFound"; - private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; - private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; - private const string ExtractionFailureValue = "ExtractionFailure"; - private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat"; - private const string EmptyRequestValue = "EmptyRequest"; - private const string MissingInputDocumentsValue = "MissingInputDocuments"; - private const string InvalidDocumentValue = "InvalidDocument"; - private const string ModelVersionIncorrectValue = "ModelVersionIncorrect"; - private const string InvalidDocumentBatchValue = "InvalidDocumentBatch"; - private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode"; - private const string InvalidCountryHintValue = "InvalidCountryHint"; - - /// InvalidRequest. - public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue); - /// InvalidParameterValue. - public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue); - /// KnowledgeBaseNotFound. - public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue); - /// AzureCognitiveSearchNotFound. - public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue); - /// AzureCognitiveSearchThrottling. - public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue); - /// ExtractionFailure. - public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue); - /// InvalidRequestBodyFormat. - public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue); - /// EmptyRequest. - public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue); - /// MissingInputDocuments. - public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue); - /// InvalidDocument. - public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue); - /// ModelVersionIncorrect. - public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue); - /// InvalidDocumentBatch. - public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue); - /// UnsupportedLanguageCode. - public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue); - /// InvalidCountryHint. - public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue); - /// Determines if two values are the same. - public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InnerErrorCode left, InnerErrorCode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator InnerErrorCode(string value) => new InnerErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InnerErrorCode other && Equals(other); - /// - public bool Equals(InnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs deleted file mode 100644 index 3b9e7a409497..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class InnerErrorModel : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (Optional.IsCollectionDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteStartObject(); - foreach (var item in Details) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"u8); - writer.WriteStringValue(Target); - } - if (Optional.IsDefined(Innererror)) - { - writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(Innererror, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - InnerErrorModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInnerErrorModel(document.RootElement, options); - } - - internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InnerErrorCode code = default; - string message = default; - IReadOnlyDictionary details = default; - string target = default; - InnerErrorModel innererror = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = new InnerErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - details = dictionary; - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = DeserializeInnerErrorModel(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InnerErrorModel( - code, - message, - details ?? new ChangeTrackingDictionary(), - target, - innererror, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{options.Format}' format."); - } - } - - InnerErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInnerErrorModel(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static InnerErrorModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInnerErrorModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs deleted file mode 100644 index 0be6c1135e2f..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - public partial class InnerErrorModel - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// is null. - internal InnerErrorModel(InnerErrorCode code, string message) - { - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// Error details. - /// Error target. - /// An object containing more specific information than the current object about the error. - /// Keeps track of any properties unknown to the library. - internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Details = details; - Target = target; - Innererror = innererror; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InnerErrorModel() - { - } - - /// One of a server-defined set of error codes. - public InnerErrorCode Code { get; } - /// Error message. - public string Message { get; } - /// Error details. - public IReadOnlyDictionary Details { get; } - /// Error target. - public string Target { get; } - /// An object containing more specific information than the current object about the error. - public InnerErrorModel Innererror { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs index 3baff424fa3e..7cd6295bf56c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs @@ -35,7 +35,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("confusionMatrix"u8); - writer.WriteObjectValue(ConfusionMatrix, options); + writer.WriteStartObject(); + foreach (var item in ConfusionMatrix) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); writer.WritePropertyName("intents"u8); writer.WriteStartObject(); foreach (var item in Intents) @@ -93,7 +99,7 @@ internal static IntentsEvaluationSummary DeserializeIntentsEvaluationSummary(Jso { return null; } - ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary confusionMatrix = default; IReadOnlyDictionary intents = default; float microF1 = default; float microPrecision = default; @@ -107,7 +113,12 @@ internal static IntentsEvaluationSummary DeserializeIntentsEvaluationSummary(Jso { if (property.NameEquals("confusionMatrix"u8)) { - confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AnalyzeConversationConfusionMatrixRow.DeserializeAnalyzeConversationConfusionMatrixRow(property0.Value, options)); + } + confusionMatrix = dictionary; continue; } if (property.NameEquals("intents"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs index ac6b62876b0c..b846a7ed1db6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs @@ -55,7 +55,7 @@ public partial class IntentsEvaluationSummary /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// or is null. - internal IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + internal IntentsEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) { Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); Argument.AssertNotNull(intents, nameof(intents)); @@ -80,7 +80,7 @@ internal IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDict /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + internal IntentsEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) { ConfusionMatrix = confusionMatrix; Intents = intents; @@ -99,7 +99,7 @@ internal IntentsEvaluationSummary() } /// Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. - public ConfusionMatrix ConfusionMatrix { get; } + public IReadOnlyDictionary ConfusionMatrix { get; } /// Represents the intents evaluation summary. public IReadOnlyDictionary Intents { get; } /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs deleted file mode 100644 index e87ebd045098..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The JobStatus. - public readonly partial struct JobStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NotStartedValue = "notStarted"; - private const string RunningValue = "running"; - private const string SucceededValue = "succeeded"; - private const string FailedValue = "failed"; - private const string CancelledValue = "cancelled"; - private const string CancellingValue = "cancelling"; - private const string PartiallyCompletedValue = "partiallyCompleted"; - - /// notStarted. - public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); - /// running. - public static JobStatus Running { get; } = new JobStatus(RunningValue); - /// succeeded. - public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); - /// failed. - public static JobStatus Failed { get; } = new JobStatus(FailedValue); - /// cancelled. - public static JobStatus Cancelled { get; } = new JobStatus(CancelledValue); - /// cancelling. - public static JobStatus Cancelling { get; } = new JobStatus(CancellingValue); - /// partiallyCompleted. - public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); - /// Determines if two values are the same. - public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator JobStatus(string value) => new JobStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobStatus other && Equals(other); - /// - public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.Serialization.cs index dc0a7a52e26b..a1fae3ffd070 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class LoadSnapshotJobState : IUtf8JsonSerializable, IJsonModel + public partial class LoadSnapshotOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(LoadSnapshotOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - LoadSnapshotJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + LoadSnapshotOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(LoadSnapshotOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLoadSnapshotJobState(document.RootElement, options); + return DeserializeLoadSnapshotOperationState(document.RootElement, options); } - internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static LoadSnapshotOperationState DeserializeLoadSnapshotOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new LoadSnapshotJobState( + return new LoadSnapshotOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(LoadSnapshotOperationState)} does not support writing '{options.Format}' format."); } } - LoadSnapshotJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + LoadSnapshotOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLoadSnapshotJobState(document.RootElement, options); + return DeserializeLoadSnapshotOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(LoadSnapshotOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static LoadSnapshotJobState FromResponse(Response response) + internal static LoadSnapshotOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeLoadSnapshotJobState(document.RootElement); + return DeserializeLoadSnapshotOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.cs index d36674e9524d..9f152c656263 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of loading a snapshot job. - public partial class LoadSnapshotJobState + public partial class LoadSnapshotOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class LoadSnapshotJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal LoadSnapshotJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal LoadSnapshotOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal LoadSnapshotJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal LoadSnapshotOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal LoadSnapshotJobState() + /// Initializes a new instance of for deserialization. + internal LoadSnapshotOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.Serialization.cs index 7f1f869f122c..c3ad9998a490 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class OrchestrationExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class OrchestrationExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -57,19 +57,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - OrchestrationExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + OrchestrationExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + return DeserializeOrchestrationExportedProjectAsset(document.RootElement, options); } - internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static OrchestrationExportedProjectAsset DeserializeOrchestrationExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExpor } IList intents = default; IList utterances = default; - ProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,7 +114,7 @@ internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExpor } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -123,46 +123,46 @@ internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExpor } } serializedAdditionalRawData = rawDataDictionary; - return new OrchestrationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); + return new OrchestrationExportedProjectAsset(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - OrchestrationExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + OrchestrationExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + return DeserializeOrchestrationExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new OrchestrationExportedProjectAssets FromResponse(Response response) + internal static new OrchestrationExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeOrchestrationExportedProjectAssets(document.RootElement); + return DeserializeOrchestrationExportedProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.cs index 1b4e9d3b238c..4a860cd82e92 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAsset.cs @@ -11,22 +11,22 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the assets of an orchestration project. - public partial class OrchestrationExportedProjectAssets : ExportedProjectAssets + public partial class OrchestrationExportedProjectAsset : ExportedProjectAsset { - /// Initializes a new instance of . - public OrchestrationExportedProjectAssets() + /// Initializes a new instance of . + public OrchestrationExportedProjectAsset() { - ProjectKind = ProjectKind.Orchestration; + ProjectKind = AnalyzeConversationAuthoringProjectKind.Orchestration; Intents = new ChangeTrackingList(); Utterances = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The type of project containing the assets. /// Keeps track of any properties unknown to the library. /// Represents the intents of the project. /// Represents the utterances of the project. - internal OrchestrationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList utterances) : base(projectKind, serializedAdditionalRawData) + internal OrchestrationExportedProjectAsset(AnalyzeConversationAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList utterances) : base(projectKind, serializedAdditionalRawData) { Intents = intents; Utterances = utterances; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs deleted file mode 100644 index 3ed3090a697d..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class PrebuiltEntities : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - PrebuiltEntities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePrebuiltEntities(document.RootElement, options); - } - - internal static PrebuiltEntities DeserializePrebuiltEntities(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PrebuiltEntity.DeserializePrebuiltEntity(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PrebuiltEntities(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support writing '{options.Format}' format."); - } - } - - PrebuiltEntities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePrebuiltEntities(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static PrebuiltEntities FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializePrebuiltEntities(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs deleted file mode 100644 index b391e65ae007..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Represents a list of the retrieved supported prebuilt entities. - public partial class PrebuiltEntities - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The supported prebuilt entities. - /// is null. - internal PrebuiltEntities(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The supported prebuilt entities. - /// The next page link. - /// Keeps track of any properties unknown to the library. - internal PrebuiltEntities(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PrebuiltEntities() - { - } - - /// The supported prebuilt entities. - public IReadOnlyList Value { get; } - /// The next page link. - public string NextLink { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs index 053665c47c53..cb42a671a12a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{format}' format."); } - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category); + if (options.Format != "W") + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); writer.WritePropertyName("examples"u8); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs index d0bfaf84131e..a8a44af01950 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs @@ -46,17 +46,14 @@ public partial class PrebuiltEntity private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The prebuilt entity category. /// The description. /// English examples for the entity. - /// , or is null. - internal PrebuiltEntity(string category, string description, string examples) + /// or is null. + internal PrebuiltEntity(string description, string examples) { - Argument.AssertNotNull(category, nameof(category)); Argument.AssertNotNull(description, nameof(description)); Argument.AssertNotNull(examples, nameof(examples)); - Category = category; Description = description; Examples = examples; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.Serialization.cs index 0126c905da8f..faadf9966b26 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ProjectDeletionJobState : IUtf8JsonSerializable, IJsonModel + public partial class ProjectDeletionOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ProjectDeletionOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectDeletionJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ProjectDeletionOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ProjectDeletionOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectDeletionJobState(document.RootElement, options); + return DeserializeProjectDeletionOperationState(document.RootElement, options); } - internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static ProjectDeletionOperationState DeserializeProjectDeletionOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonE DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonE } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectDeletionJobState( + return new ProjectDeletionOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProjectDeletionOperationState)} does not support writing '{options.Format}' format."); } } - ProjectDeletionJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ProjectDeletionOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectDeletionJobState(document.RootElement, options); + return DeserializeProjectDeletionOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProjectDeletionOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectDeletionJobState FromResponse(Response response) + internal static ProjectDeletionOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectDeletionJobState(document.RootElement); + return DeserializeProjectDeletionOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.cs index 6a51e6c587e7..8b8bf193ec48 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a project deletion job. - public partial class ProjectDeletionJobState + public partial class ProjectDeletionOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ProjectDeletionJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ProjectDeletionJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal ProjectDeletionOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ProjectDeletionJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal ProjectDeletionOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectDeletionJobState() + /// Initializes a new instance of for deserialization. + internal ProjectDeletionOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs index 2cd30a980287..cd9badd71875 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WriteStringValue(LastDeployedOn, "O"); writer.WritePropertyName("deploymentExpirationDate"u8); - writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WriteStringValue(DeploymentExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); writer.WritePropertyName("assignedResources"u8); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs index ef0a3c0feb3e..103dcb92c800 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs @@ -48,22 +48,22 @@ public partial class ProjectDeployment /// Initializes a new instance of . /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Represents model training config version. /// Represents the metadata of the assigned Azure resources. /// , or is null. - internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiredOn, string modelTrainingConfigVersion, IEnumerable assignedResources) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); Argument.AssertNotNull(assignedResources, nameof(assignedResources)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; + DeploymentExpiredOn = deploymentExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; AssignedResources = assignedResources.ToList(); } @@ -71,19 +71,19 @@ internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedDateTime, D /// Initializes a new instance of . /// Represents deployment name. /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Represents model training config version. /// Represents the metadata of the assigned Azure resources. /// Keeps track of any properties unknown to the library. - internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiredOn, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) { DeploymentName = deploymentName; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; + DeploymentExpiredOn = deploymentExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; AssignedResources = assignedResources; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -99,11 +99,11 @@ internal ProjectDeployment() /// Represents deployment modelId. public string ModelId { get; } /// Represents deployment last trained time. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// Represents deployment last deployed time. - public DateTimeOffset LastDeployedDateTime { get; } + public DateTimeOffset LastDeployedOn { get; } /// Represents deployment expiration date in the runtime. - public DateTimeOffset DeploymentExpirationDate { get; } + public DateTimeOffset DeploymentExpiredOn { get; } /// Represents model training config version. public string ModelTrainingConfigVersion { get; } /// Represents the metadata of the assigned Azure resources. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs deleted file mode 100644 index d673512f2717..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The ProjectKind. - public readonly partial struct ProjectKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ProjectKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ConversationValue = "Conversation"; - private const string OrchestrationValue = "Orchestration"; - private const string CustomConversationSummarizationValue = "CustomConversationSummarization"; - - /// A project to build natural language into apps, bots, and IoT devices. - public static ProjectKind Conversation { get; } = new ProjectKind(ConversationValue); - /// A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project. - public static ProjectKind Orchestration { get; } = new ProjectKind(OrchestrationValue); - /// A project to build conversation summarization models which are able to summarize long conversations. - public static ProjectKind CustomConversationSummarization { get; } = new ProjectKind(CustomConversationSummarizationValue); - /// Determines if two values are the same. - public static bool operator ==(ProjectKind left, ProjectKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ProjectKind left, ProjectKind right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ProjectKind(string value) => new ProjectKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ProjectKind other && Equals(other); - /// - public bool Equals(ProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs index 1702bef36f89..aa91935eb528 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs @@ -35,18 +35,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastModifiedDateTime"u8); - writer.WriteStringValue(LastModifiedDateTime, "O"); - if (Optional.IsDefined(LastTrainedDateTime)) + writer.WriteStringValue(LastModifiedOn, "O"); + if (Optional.IsDefined(LastTrainedOn)) { writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + writer.WriteStringValue(LastTrainedOn.Value, "O"); } - if (Optional.IsDefined(LastDeployedDateTime)) + if (Optional.IsDefined(LastDeployedOn)) { writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + writer.WriteStringValue(LastDeployedOn.Value, "O"); } writer.WritePropertyName("projectKind"u8); writer.WriteStringValue(ProjectKind.ToString()); @@ -115,8 +115,8 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, DateTimeOffset lastModifiedDateTime = default; DateTimeOffset? lastTrainedDateTime = default; DateTimeOffset? lastDeployedDateTime = default; - ProjectKind projectKind = default; - ProjectSettings settings = default; + AnalyzeConversationAuthoringProjectKind projectKind = default; + AnalyzeConversationAuthoringProjectSettings settings = default; string storageInputContainerName = default; string projectName = default; bool? multilingual = default; @@ -156,7 +156,7 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("settings"u8)) @@ -165,7 +165,7 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, { continue; } - settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + settings = AnalyzeConversationAuthoringProjectSettings.DeserializeAnalyzeConversationAuthoringProjectSettings(property.Value, options); continue; } if (property.NameEquals("storageInputContainerName"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs index c8e18988fe7e..6bff624bd4f4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs @@ -46,29 +46,29 @@ public partial class ProjectMetadata private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project creation datetime. /// Represents the project kind. /// The new project name. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// or is null. - internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string projectName, string language) + internal ProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, AnalyzeConversationAuthoringProjectKind projectKind, string projectName, string language) { Argument.AssertNotNull(projectName, nameof(projectName)); Argument.AssertNotNull(language, nameof(language)); - CreatedDateTime = createdDateTime; - LastModifiedDateTime = lastModifiedDateTime; + CreatedOn = createdOn; + LastModifiedOn = lastModifiedOn; ProjectKind = projectKind; ProjectName = projectName; Language = language; } /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project creation datetime. - /// Represents the project last trained datetime. - /// Represents the project last deployed datetime. + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. /// Represents the project kind. /// The project settings. /// The storage container name in case of conversation summarization. @@ -77,12 +77,12 @@ internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModi /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal ProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, AnalyzeConversationAuthoringProjectKind projectKind, AnalyzeConversationAuthoringProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { - CreatedDateTime = createdDateTime; - LastModifiedDateTime = lastModifiedDateTime; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; + CreatedOn = createdOn; + LastModifiedOn = lastModifiedOn; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; ProjectKind = projectKind; Settings = settings; StorageInputContainerName = storageInputContainerName; @@ -99,17 +99,17 @@ internal ProjectMetadata() } /// Represents the project creation datetime. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// Represents the project creation datetime. - public DateTimeOffset LastModifiedDateTime { get; } + public DateTimeOffset LastModifiedOn { get; } /// Represents the project last trained datetime. - public DateTimeOffset? LastTrainedDateTime { get; } + public DateTimeOffset? LastTrainedOn { get; } /// Represents the project last deployed datetime. - public DateTimeOffset? LastDeployedDateTime { get; } + public DateTimeOffset? LastDeployedOn { get; } /// Represents the project kind. - public ProjectKind ProjectKind { get; } + public AnalyzeConversationAuthoringProjectKind ProjectKind { get; } /// The project settings. - public ProjectSettings Settings { get; } + public AnalyzeConversationAuthoringProjectSettings Settings { get; } /// The storage container name in case of conversation summarization. public string StorageInputContainerName { get; } /// The new project name. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs index 6e7eaa0108c9..15f2ff225f15 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastTrainingDurationInSeconds"u8); writer.WriteNumberValue(LastTrainingDurationInSeconds); writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); writer.WritePropertyName("hasSnapshot"u8); diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs index 1fbc9b616db0..2b699955b47b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs @@ -47,21 +47,21 @@ public partial class ProjectTrainedModel /// Initializes a new instance of . /// The model ID. - /// The last trained date time of the model. + /// The last trained date time of the model. /// The duration of the model's last training request in seconds. - /// The model expiration date. + /// The model expiration date. /// The model training config version. /// The flag to indicate if the trained model has a snapshot ready. /// or is null. - internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedOn, int lastTrainingDurationInSeconds, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, bool hasSnapshot) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; + LastTrainedOn = lastTrainedOn; LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; HasSnapshot = hasSnapshot; } @@ -69,19 +69,19 @@ internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, /// Initializes a new instance of . /// The trained model label. /// The model ID. - /// The last trained date time of the model. + /// The last trained date time of the model. /// The duration of the model's last training request in seconds. - /// The model expiration date. + /// The model expiration date. /// The model training config version. /// The flag to indicate if the trained model has a snapshot ready. /// Keeps track of any properties unknown to the library. - internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedOn, int lastTrainingDurationInSeconds, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) { Label = label; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; + LastTrainedOn = lastTrainedOn; LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; HasSnapshot = hasSnapshot; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -97,11 +97,11 @@ internal ProjectTrainedModel() /// The model ID. public string ModelId { get; } /// The last trained date time of the model. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// The duration of the model's last training request in seconds. public int LastTrainingDurationInSeconds { get; } /// The model expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } /// The model training config version. public string ModelTrainingConfigVersion { get; } /// The flag to indicate if the trained model has a snapshot ready. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs index ad609f62ed3a..6a316b260c5a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs @@ -23,9 +23,15 @@ public StringIndexType(string value) } private const string Utf16CodeUnitValue = "Utf16CodeUnit"; + private const string Utf8CodeUnitValue = "Utf8CodeUnit"; + private const string Utf32CodeUnitValue = "Utf32CodeUnit"; /// The offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. public static StringIndexType Utf16CodeUnit { get; } = new StringIndexType(Utf16CodeUnitValue); + /// Utf8CodeUnit. + public static StringIndexType Utf8CodeUnit { get; } = new StringIndexType(Utf8CodeUnitValue); + /// Utf32CodeUnit. + public static StringIndexType Utf32CodeUnit { get; } = new StringIndexType(Utf32CodeUnitValue); /// Determines if two values are the same. public static bool operator ==(StringIndexType left, StringIndexType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.Serialization.cs similarity index 68% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.Serialization.cs index 34b55b9c7674..00b3477e56a2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class SubTrainingJobState : IUtf8JsonSerializable, IJsonModel + public partial class SubTrainingOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,23 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SubTrainingOperationState)} does not support writing '{format}' format."); } writer.WritePropertyName("percentComplete"u8); writer.WriteNumberValue(PercentComplete); - if (Optional.IsDefined(StartDateTime)) + if (Optional.IsDefined(StartedOn)) { writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartDateTime.Value, "O"); + writer.WriteStringValue(StartedOn.Value, "O"); } - if (Optional.IsDefined(EndDateTime)) + if (Optional.IsDefined(EndedOn)) { writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndDateTime.Value, "O"); + writer.WriteStringValue(EndedOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubTrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SubTrainingOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SubTrainingOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSubTrainingJobState(document.RootElement, options); + return DeserializeSubTrainingOperationState(document.RootElement, options); } - internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static SubTrainingOperationState DeserializeSubTrainingOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e int percentComplete = default; DateTimeOffset? startDateTime = default; DateTimeOffset? endDateTime = default; - JobStatus status = default; + ConversationAuthoringOperationStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -118,7 +118,7 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -127,46 +127,46 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); + return new SubTrainingOperationState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SubTrainingOperationState)} does not support writing '{options.Format}' format."); } } - SubTrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SubTrainingOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSubTrainingJobState(document.RootElement, options); + return DeserializeSubTrainingOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SubTrainingOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SubTrainingJobState FromResponse(Response response) + internal static SubTrainingOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSubTrainingJobState(document.RootElement); + return DeserializeSubTrainingOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.cs index bf95c7414ab8..764b488a54dc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the detailed state of a training sub-operation. - public partial class SubTrainingJobState + public partial class SubTrainingOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,42 +45,42 @@ public partial class SubTrainingJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. /// Represents the status of the sub-operation. - internal SubTrainingJobState(int percentComplete, JobStatus status) + internal SubTrainingOperationState(int percentComplete, ConversationAuthoringOperationStatus status) { PercentComplete = percentComplete; Status = status; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. - /// Represents the start date time. - /// Represents the end date time. + /// Represents the start date time. + /// Represents the end date time. /// Represents the status of the sub-operation. /// Keeps track of any properties unknown to the library. - internal SubTrainingJobState(int percentComplete, DateTimeOffset? startDateTime, DateTimeOffset? endDateTime, JobStatus status, IDictionary serializedAdditionalRawData) + internal SubTrainingOperationState(int percentComplete, DateTimeOffset? startedOn, DateTimeOffset? endedOn, ConversationAuthoringOperationStatus status, IDictionary serializedAdditionalRawData) { PercentComplete = percentComplete; - StartDateTime = startDateTime; - EndDateTime = endDateTime; + StartedOn = startedOn; + EndedOn = endedOn; Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SubTrainingJobState() + /// Initializes a new instance of for deserialization. + internal SubTrainingOperationState() { } /// Represents progress percentage. public int PercentComplete { get; } /// Represents the start date time. - public DateTimeOffset? StartDateTime { get; } + public DateTimeOffset? StartedOn { get; } /// Represents the end date time. - public DateTimeOffset? EndDateTime { get; } + public DateTimeOffset? EndedOn { get; } /// Represents the status of the sub-operation. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs index b57d25aa07b2..c1aafb486d63 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{format}' format."); } - writer.WritePropertyName("languageName"u8); - writer.WriteStringValue(LanguageName); + if (options.Format != "W") + { + writer.WritePropertyName("languageName"u8); + writer.WriteStringValue(LanguageName); + } writer.WritePropertyName("languageCode"u8); writer.WriteStringValue(LanguageCode); if (options.Format != "W" && _serializedAdditionalRawData != null) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs index cc3293a6b09c..3daa571a76c2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs @@ -46,15 +46,12 @@ public partial class SupportedLanguage private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The language name. /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// or is null. - internal SupportedLanguage(string languageName, string languageCode) + /// is null. + internal SupportedLanguage(string languageCode) { - Argument.AssertNotNull(languageName, nameof(languageName)); Argument.AssertNotNull(languageCode, nameof(languageCode)); - LanguageName = languageName; LanguageCode = languageCode; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs deleted file mode 100644 index 10dfb02e3505..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class SupportedLanguages : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SupportedLanguages)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SupportedLanguages IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SupportedLanguages)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSupportedLanguages(document.RootElement, options); - } - - internal static SupportedLanguages DeserializeSupportedLanguages(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SupportedLanguage.DeserializeSupportedLanguage(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SupportedLanguages(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(SupportedLanguages)} does not support writing '{options.Format}' format."); - } - } - - SupportedLanguages IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSupportedLanguages(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SupportedLanguages)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static SupportedLanguages FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeSupportedLanguages(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs deleted file mode 100644 index 573a75efe97f..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Represents a list of retrieved languages. - public partial class SupportedLanguages - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The list of the languages. - /// is null. - internal SupportedLanguages(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The list of the languages. - /// The next page link. - /// Keeps track of any properties unknown to the library. - internal SupportedLanguages(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal SupportedLanguages() - { - } - - /// The list of the languages. - public IReadOnlyList Value { get; } - /// The next page link. - public string NextLink { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.Serialization.cs index 11247b186dd9..c0a7793de9fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class SwapDeploymentsJobState : IUtf8JsonSerializable, IJsonModel + public partial class SwapDeploymentsOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SwapDeploymentsOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SwapDeploymentsJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SwapDeploymentsOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SwapDeploymentsOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSwapDeploymentsJobState(document.RootElement, options); + return DeserializeSwapDeploymentsOperationState(document.RootElement, options); } - internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static SwapDeploymentsOperationState DeserializeSwapDeploymentsOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new SwapDeploymentsJobState( + return new SwapDeploymentsOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SwapDeploymentsOperationState)} does not support writing '{options.Format}' format."); } } - SwapDeploymentsJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SwapDeploymentsOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSwapDeploymentsJobState(document.RootElement, options); + return DeserializeSwapDeploymentsOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SwapDeploymentsOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SwapDeploymentsJobState FromResponse(Response response) + internal static SwapDeploymentsOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSwapDeploymentsJobState(document.RootElement); + return DeserializeSwapDeploymentsOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.cs index 23f81396d899..3e471669b25b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a deployment job. - public partial class SwapDeploymentsJobState + public partial class SwapDeploymentsOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class SwapDeploymentsJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal SwapDeploymentsJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal SwapDeploymentsOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal SwapDeploymentsJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal SwapDeploymentsOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SwapDeploymentsJobState() + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs index 7811d7667b24..f3d7b7a94852 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs @@ -34,10 +34,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{format}' format."); } - writer.WritePropertyName("trainingConfigVersion"u8); - writer.WriteStringValue(TrainingConfigVersionProperty); + if (options.Format != "W") + { + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersionProperty); + } writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs index 17e1509a0e00..2e446be51b45 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs @@ -46,25 +46,20 @@ public partial class TrainingConfigVersion private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Represents the version of the config. - /// Represents the training config version expiration date. - /// is null. - internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate) + /// Represents the training config version expiration date. + internal TrainingConfigVersion(DateTimeOffset modelExpiredOn) { - Argument.AssertNotNull(trainingConfigVersionProperty, nameof(trainingConfigVersionProperty)); - - TrainingConfigVersionProperty = trainingConfigVersionProperty; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; } /// Initializes a new instance of . /// Represents the version of the config. - /// Represents the training config version expiration date. + /// Represents the training config version expiration date. /// Keeps track of any properties unknown to the library. - internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate, IDictionary serializedAdditionalRawData) + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpiredOn, IDictionary serializedAdditionalRawData) { TrainingConfigVersionProperty = trainingConfigVersionProperty; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,6 +71,6 @@ internal TrainingConfigVersion() /// Represents the version of the config. public string TrainingConfigVersionProperty { get; } /// Represents the training config version expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs deleted file mode 100644 index b2ca76809d13..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - public partial class TrainingConfigVersions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TrainingConfigVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingConfigVersions(document.RootElement, options); - } - - internal static TrainingConfigVersions DeserializeTrainingConfigVersions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TrainingConfigVersion.DeserializeTrainingConfigVersion(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TrainingConfigVersions(value, nextLink, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support writing '{options.Format}' format."); - } - } - - TrainingConfigVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingConfigVersions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static TrainingConfigVersions FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingConfigVersions(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs deleted file mode 100644 index e9843b7eec26..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// Represents a list of training config versions. - public partial class TrainingConfigVersions - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The list of the training config versions. - /// is null. - internal TrainingConfigVersions(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of . - /// The list of the training config versions. - /// The next page link. - /// Keeps track of any properties unknown to the library. - internal TrainingConfigVersions(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TrainingConfigVersions() - { - } - - /// The list of the training config versions. - public IReadOnlyList Value { get; } - /// The next page link. - public string NextLink { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs index 523f1676b7c8..b440930ad6a8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs @@ -87,7 +87,7 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele } string modelLabel = default; string trainingConfigVersion = default; - TrainingMode trainingMode = default; + AnalyzeConversationAuthoringTrainingMode trainingMode = default; EvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,7 +105,7 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele } if (property.NameEquals("trainingMode"u8)) { - trainingMode = new TrainingMode(property.Value.GetString()); + trainingMode = new AnalyzeConversationAuthoringTrainingMode(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs index 3feb12923271..3bc0d14e88a6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs @@ -49,7 +49,7 @@ public partial class TrainingJobDetails /// Represents the output model label. /// Represents the mode of the training operation. /// is null. - public TrainingJobDetails(string modelLabel, TrainingMode trainingMode) + public TrainingJobDetails(string modelLabel, AnalyzeConversationAuthoringTrainingMode trainingMode) { Argument.AssertNotNull(modelLabel, nameof(modelLabel)); @@ -63,7 +63,7 @@ public TrainingJobDetails(string modelLabel, TrainingMode trainingMode) /// Represents the mode of the training operation. /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. /// Keeps track of any properties unknown to the library. - internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, TrainingMode trainingMode, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) + internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, AnalyzeConversationAuthoringTrainingMode trainingMode, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) { ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; @@ -82,7 +82,7 @@ internal TrainingJobDetails() /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. public string TrainingConfigVersion { get; set; } /// Represents the mode of the training operation. - public TrainingMode TrainingMode { get; } + public AnalyzeConversationAuthoringTrainingMode TrainingMode { get; } /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. public EvaluationDetails EvaluationOptions { get; set; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs index 583091695fdd..095579c03cc9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs @@ -50,10 +50,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("evaluationStatus"u8); writer.WriteObjectValue(EvaluationStatus, options); } - if (Optional.IsDefined(EstimatedEndDateTime)) + if (Optional.IsDefined(EstimatedEndOn)) { writer.WritePropertyName("estimatedEndDateTime"u8); - writer.WriteStringValue(EstimatedEndDateTime.Value, "O"); + writer.WriteStringValue(EstimatedEndOn.Value, "O"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,9 +94,9 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme } string modelLabel = default; string trainingConfigVersion = default; - TrainingMode? trainingMode = default; - SubTrainingJobState trainingStatus = default; - SubTrainingJobState evaluationStatus = default; + AnalyzeConversationAuthoringTrainingMode? trainingMode = default; + SubTrainingOperationState trainingStatus = default; + SubTrainingOperationState evaluationStatus = default; DateTimeOffset? estimatedEndDateTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -118,12 +118,12 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme { continue; } - trainingMode = new TrainingMode(property.Value.GetString()); + trainingMode = new AnalyzeConversationAuthoringTrainingMode(property.Value.GetString()); continue; } if (property.NameEquals("trainingStatus"u8)) { - trainingStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + trainingStatus = SubTrainingOperationState.DeserializeSubTrainingOperationState(property.Value, options); continue; } if (property.NameEquals("evaluationStatus"u8)) @@ -132,7 +132,7 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme { continue; } - evaluationStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + evaluationStatus = SubTrainingOperationState.DeserializeSubTrainingOperationState(property.Value, options); continue; } if (property.NameEquals("estimatedEndDateTime"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs index 720a34cb1f3a..febdbc8c42c8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs @@ -50,7 +50,7 @@ public partial class TrainingJobResult /// Represents training config version. /// Represents the model training status. /// , or is null. - internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus) + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingOperationState trainingStatus) { Argument.AssertNotNull(modelLabel, nameof(modelLabel)); Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); @@ -67,16 +67,16 @@ internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubT /// Represents the mode of the training operation. /// Represents the model training status. /// Represents model evaluation status. - /// Represents the estimated end date time for training and evaluation. + /// Represents the estimated end date time for training and evaluation. /// Keeps track of any properties unknown to the library. - internal TrainingJobResult(string modelLabel, string trainingConfigVersion, TrainingMode? trainingMode, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, AnalyzeConversationAuthoringTrainingMode? trainingMode, SubTrainingOperationState trainingStatus, SubTrainingOperationState evaluationStatus, DateTimeOffset? estimatedEndOn, IDictionary serializedAdditionalRawData) { ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; TrainingMode = trainingMode; TrainingStatus = trainingStatus; EvaluationStatus = evaluationStatus; - EstimatedEndDateTime = estimatedEndDateTime; + EstimatedEndOn = estimatedEndOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,12 +90,12 @@ internal TrainingJobResult() /// Represents training config version. public string TrainingConfigVersion { get; } /// Represents the mode of the training operation. - public TrainingMode? TrainingMode { get; } + public AnalyzeConversationAuthoringTrainingMode? TrainingMode { get; } /// Represents the model training status. - public SubTrainingJobState TrainingStatus { get; } + public SubTrainingOperationState TrainingStatus { get; } /// Represents model evaluation status. - public SubTrainingJobState EvaluationStatus { get; } + public SubTrainingOperationState EvaluationStatus { get; } /// Represents the estimated end date time for training and evaluation. - public DateTimeOffset? EstimatedEndDateTime { get; } + public DateTimeOffset? EstimatedEndOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs deleted file mode 100644 index 8b3ba74604b3..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Conversations.Authoring.Models -{ - /// The TrainingMode. - public readonly partial struct TrainingMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TrainingMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AdvancedValue = "advanced"; - private const string StandardValue = "standard"; - - /// Trains using fine-tuned neural network transformer models. Can train multilingual projects. - public static TrainingMode Advanced { get; } = new TrainingMode(AdvancedValue); - /// Faster training times for quicker iterations. - public static TrainingMode Standard { get; } = new TrainingMode(StandardValue); - /// Determines if two values are the same. - public static bool operator ==(TrainingMode left, TrainingMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TrainingMode left, TrainingMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator TrainingMode(string value) => new TrainingMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TrainingMode other && Equals(other); - /// - public bool Equals(TrainingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.Serialization.cs similarity index 71% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.Serialization.cs index 00058b957bf1..abeb248722bf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class TrainingJobState : IUtf8JsonSerializable, IJsonModel + public partial class TrainingOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TrainingOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -89,19 +89,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TrainingOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TrainingOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingJobState(document.RootElement, options); + return DeserializeTrainingOperationState(document.RootElement, options); } - internal static TrainingJobState DeserializeTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TrainingOperationState DeserializeTrainingOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -113,9 +113,9 @@ internal static TrainingJobState DeserializeTrainingJobState(JsonElement element DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + ConversationAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; TrainingJobResult result = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -147,7 +147,7 @@ internal static TrainingJobState DeserializeTrainingJobState(JsonElement element } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new ConversationAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -156,10 +156,10 @@ internal static TrainingJobState DeserializeTrainingJobState(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -170,10 +170,10 @@ internal static TrainingJobState DeserializeTrainingJobState(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -189,55 +189,55 @@ internal static TrainingJobState DeserializeTrainingJobState(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new TrainingJobState( + return new TrainingOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), result, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TrainingOperationState)} does not support writing '{options.Format}' format."); } } - TrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TrainingOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingJobState(document.RootElement, options); + return DeserializeTrainingOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TrainingOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TrainingJobState FromResponse(Response response) + internal static TrainingOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingJobState(document.RootElement); + return DeserializeTrainingOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.cs index 882cd133cc27..ac1ead90c2f1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { /// Represents the state of a training job. - public partial class TrainingJobState + public partial class TrainingOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,40 +45,40 @@ public partial class TrainingJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. /// Represents training tasks detailed result. /// is null. - internal TrainingJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + internal TrainingOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ConversationAuthoringOperationStatus status, TrainingJobResult result) { Argument.AssertNotNull(result, nameof(result)); - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); Result = result; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents training tasks detailed result. /// Keeps track of any properties unknown to the library. - internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + internal TrainingOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, ConversationAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; @@ -86,25 +86,25 @@ internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTime _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TrainingJobState() + /// Initializes a new instance of for deserialization. + internal TrainingOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public ConversationAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Represents training tasks detailed result. public TrainingJobResult Result { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.Serialization.cs similarity index 60% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.Serialization.cs index 90fd010370fe..0a248517d34a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - internal partial class UnknownExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeExportedProjectAsset(document.RootElement, options); } - internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownExportedProjectAsset DeserializeUnknownExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,14 +57,14 @@ internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAs { return null; } - ProjectKind projectKind = "Unknown"; + AnalyzeConversationAuthoringProjectKind projectKind = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new AnalyzeConversationAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -73,53 +73,53 @@ internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAs } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownExportedProjectAssets(projectKind, serializedAdditionalRawData); + return new UnknownExportedProjectAsset(projectKind, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new UnknownExportedProjectAssets FromResponse(Response response) + internal static new UnknownExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownExportedProjectAssets(document.RootElement); + return DeserializeUnknownExportedProjectAsset(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.cs similarity index 55% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.cs index 8a716c535450..dbdd9670db52 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAsset.cs @@ -10,18 +10,18 @@ namespace Azure.AI.Language.Conversations.Authoring.Models { - /// Unknown version of ExportedProjectAssets. - internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + /// Unknown version of ExportedProjectAsset. + internal partial class UnknownExportedProjectAsset : ExportedProjectAsset { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The type of project containing the assets. /// Keeps track of any properties unknown to the library. - internal UnknownExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) + internal UnknownExportedProjectAsset(AnalyzeConversationAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownExportedProjectAssets() + /// Initializes a new instance of for deserialization. + internal UnknownExportedProjectAsset() { } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs deleted file mode 100644 index bc4759b14658..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs +++ /dev/null @@ -1,6466 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Azure.AI.Language.Conversations.Authoring.Models; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.Language.Conversations.Authoring.Samples -{ - public partial class Samples_AnalyzeConversationAuthoring - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - projectName = "", - language = "", - }); - Response response = client.CreateProject("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - projectName = "", - language = "", - }); - Response response = await client.CreateProjectAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }); - Response response = client.CreateProject("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }); - Response response = await client.CreateProjectAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - }); - Response response = client.CopyProjectAuthorization("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - }); - Response response = await client.CopyProjectAuthorizationAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - storageInputContainerName = "", - allowOverwrite = true, - }); - Response response = client.CopyProjectAuthorization("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - storageInputContainerName = "", - allowOverwrite = true, - }); - Response response = await client.CopyProjectAuthorizationAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("resultUrl").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("resultUrl").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.DeleteTrainedModel("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.DeleteTrainedModelAsync("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.DeleteTrainedModel("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.DeleteTrainedModelAsync("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); - Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignedResourceDeployments(null, null, null, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignedResourceDeployments(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignedResourceDeploymentsAsync(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedLanguages("Conversation"); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedLanguagesAsync("Conversation"); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedLanguages(ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedPrebuiltEntities(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedPrebuiltEntitiesAsync(); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingConfigVersions("Conversation"); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("nextLink").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetProjects(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectMetadata item in client.GetProjects()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectMetadata item in client.GetProjectsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectDeployment item in client.GetDeployments("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectTrainedModel item in client.GetTrainedModels("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("text").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); - Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); - Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingJobState item in client.GetTrainingJobs("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ExportedTrainedModel item in client.GetExportedModels("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteProject(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteProject(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = client.CopyProject(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.Conversation, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = client.CopyProject(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.Conversation, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = client.CopyProject(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "Conversation", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.Conversation, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = client.CopyProject(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.Conversation, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Export_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Export_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Export_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Export_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Export_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Export_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Export_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Export_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Import_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - projectName = "", - language = "", - }, - }); - Operation operation = client.Import(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Import_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - projectName = "", - language = "", - }, - }); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Import_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); - Operation operation = client.Import(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Import_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Import_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - intents = new object[] - { -new -{ -category = "", -} - }, - entities = new object[] - { -new -{ -category = "", -compositionSetting = "returnLongestOverlap", -list = new -{ -sublists = new object[] -{ -new -{ -listKey = "", -synonyms = new object[] -{ -new -{ -language = "", -values = new object[] -{ -"" -}, -} -}, -} -}, -}, -prebuilts = new object[] -{ -new -{ -category = "", -} -}, -regex = new -{ -expressions = new object[] -{ -new -{ -regexKey = "", -language = "", -regexPattern = "", -} -}, -}, -requiredComponents = new object[] -{ -"" -}, -} - }, - utterances = new object[] - { -new -{ -entities = new object[] -{ -new -{ -category = "", -offset = 1234, -length = 1234, -} -}, -text = "", -language = "", -intent = "", -dataset = "", -} - }, - projectKind = "Conversation", - }, - }); - Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Import_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "Conversation", - settings = new - { - confidenceThreshold = 123.45F, - }, - storageInputContainerName = "", - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - intents = new object[] - { -new -{ -category = "", -} - }, - entities = new object[] - { -new -{ -category = "", -compositionSetting = "returnLongestOverlap", -list = new -{ -sublists = new object[] -{ -new -{ -listKey = "", -synonyms = new object[] -{ -new -{ -language = "", -values = new object[] -{ -"" -}, -} -}, -} -}, -}, -prebuilts = new object[] -{ -new -{ -category = "", -} -}, -regex = new -{ -expressions = new object[] -{ -new -{ -regexKey = "", -language = "", -regexPattern = "", -} -}, -}, -requiredComponents = new object[] -{ -"" -}, -} - }, - utterances = new object[] - { -new -{ -entities = new object[] -{ -new -{ -category = "", -offset = 1234, -length = 1234, -} -}, -text = "", -language = "", -intent = "", -dataset = "", -} - }, - projectKind = "Conversation", - }, - }); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Import_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") - { - Settings = new ProjectSettings(123.45F), - StorageInputContainerName = "", - Multilingual = true, - Description = "", - }) - { - Assets = new ConversationExportedProjectAssets - { - Intents = { new ConversationExportedIntent("") }, - Entities = {new ConversationExportedEntity("") -{ -CompositionSetting = CompositionSetting.ReturnLongestOverlap, -List = new ExportedEntityList -{ -Sublists = {new ExportedEntitySublist -{ -ListKey = "", -Synonyms = {new ExportedEntityListSynonym -{ -Language = "", -Values = {""}, -}}, -}}, -}, -Prebuilts = {new ExportedPrebuiltEntity("")}, -Regex = new ExportedEntityRegex -{ -Expressions = {new ExportedEntityRegexExpression -{ -RegexKey = "", -Language = "", -RegexPattern = "", -}}, -}, -RequiredComponents = {""}, -}}, - Utterances = {new ConversationExportedUtterance("", "") -{ -Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, -Language = "", -Dataset = "", -}}, - }, - }; - Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Import_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") - { - Settings = new ProjectSettings(123.45F), - StorageInputContainerName = "", - Multilingual = true, - Description = "", - }) - { - Assets = new ConversationExportedProjectAssets - { - Intents = { new ConversationExportedIntent("") }, - Entities = {new ConversationExportedEntity("") -{ -CompositionSetting = CompositionSetting.ReturnLongestOverlap, -List = new ExportedEntityList -{ -Sublists = {new ExportedEntitySublist -{ -ListKey = "", -Synonyms = {new ExportedEntityListSynonym -{ -Language = "", -Values = {""}, -}}, -}}, -}, -Prebuilts = {new ExportedPrebuiltEntity("")}, -Regex = new ExportedEntityRegex -{ -Expressions = {new ExportedEntityRegexExpression -{ -RegexKey = "", -Language = "", -RegexPattern = "", -}}, -}, -RequiredComponents = {""}, -}}, - Utterances = {new ConversationExportedUtterance("", "") -{ -Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, -Language = "", -Dataset = "", -}}, - }, - }; - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Train_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingMode = "advanced", - }); - Operation operation = client.Train(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Train_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingMode = "advanced", - }); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Train_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); - Operation operation = client.Train(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Train_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Train_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - trainingMode = "advanced", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - }); - Operation operation = client.Train(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Train_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - trainingMode = "advanced", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - }); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_Train_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) - { - TrainingConfigVersion = "", - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - }; - Operation operation = client.Train(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_Train_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) - { - TrainingConfigVersion = "", - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - }; - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails(""); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails(""); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeployProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails("") - { - AssignedResourceIds = { "" }, - }; - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails("") - { - AssignedResourceIds = { "" }, - }; - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeployment_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeployment_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeployment_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeployment_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails(); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails(); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails - { - AssignedResourceIds = { "" }, - }; - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails - { - AssignedResourceIds = { "" }, - }; - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails(); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails(); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }; - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }; - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_LoadSnapshot_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_LoadSnapshot_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_LoadSnapshot_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_LoadSnapshot_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingMode").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_DeleteExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_DeleteExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml index 66b85f8aaf90..3efeecd52efb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cognitiveservices/Language.AnalyzeConversations-authoring -commit: 1bbb8f628f6e3083b73a2190e15bb0f5911571a3 +commit: 0f6d127b3922dfa2f75e48cf9f77d70b717bb434 repo: Azure/azure-rest-api-specs - +additionalDirectories: diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs index c9d187a629d9..78c8835bc5ad 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs @@ -6,13 +6,16 @@ #nullable disable using System; +using System.Threading; +using Autorest.CSharp.Core; +using Azure.AI.Language.Text.Authoring.Models; using Azure.Core; using Azure.Core.Pipeline; namespace Azure.AI.Language.Text.Authoring { // Data plane generated client. - /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. + /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. public partial class AuthoringClient { private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; @@ -21,6 +24,7 @@ public partial class AuthoringClient private readonly TokenCredential _tokenCredential; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; + private readonly string _apiVersion; /// The ClientDiagnostics is used to provide tracing support for the client library. internal ClientDiagnostics ClientDiagnostics { get; } @@ -64,6 +68,7 @@ public AuthoringClient(Uri endpoint, AzureKeyCredential credential, AuthoringCli _keyCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); _endpoint = endpoint; + _apiVersion = options.Version; } /// Initializes a new instance of AuthoringClient. @@ -81,16 +86,1375 @@ public AuthoringClient(Uri endpoint, TokenCredential credential, AuthoringClient _tokenCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); _endpoint = endpoint; + _apiVersion = options.Version; } - /// Initializes a new instance of TextAnalysisAuthoring. - /// The API version to use for this operation. - /// is null. - public virtual TextAnalysisAuthoring GetTextAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectMetadata.DeserializeTextAuthoringProjectMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectMetadata.DeserializeTextAuthoringProjectMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetProjects", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectDeployment.DeserializeTextAuthoringProjectDeployment(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectDeployment.DeserializeTextAuthoringProjectDeployment(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringExportedTrainedModel.DeserializeTextAuthoringExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringExportedTrainedModel.DeserializeTextAuthoringExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetExportedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectTrainedModel.DeserializeTextAuthoringProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringProjectTrainedModel.DeserializeTextAuthoringProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainedModels", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringAssignedDeploymentResource.DeserializeTextAuthoringAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringAssignedDeploymentResource.DeserializeTextAuthoringAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetDeploymentResources", "value", "nextLink", maxpagesize, context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringTrainingOperationState.DeserializeTextAuthoringTrainingOperationState(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - return new TextAnalysisAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringTrainingOperationState.DeserializeTextAuthoringTrainingOperationState(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingJobs", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringAssignedProjectDeploymentsMetadata.DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetAssignedResourceDeployments(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringAssignedProjectDeploymentsMetadata.DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetSupportedLanguagesAsync(TextAuthoringProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringSupportedLanguage.DeserializeTextAuthoringSupportedLanguage(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetSupportedLanguages(TextAuthoringProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringSupportedLanguage.DeserializeTextAuthoringSupportedLanguage(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The cancellation token to use. + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringPrebuiltEntity.DeserializeTextAuthoringPrebuiltEntity(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The cancellation token to use. + public virtual Pageable GetSupportedPrebuiltEntities(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringPrebuiltEntity.DeserializeTextAuthoringPrebuiltEntity(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetSupportedPrebuiltEntities(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual AsyncPageable GetTrainingConfigVersionsAsync(TextAuthoringProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringTrainingConfigVersion.DeserializeTextAuthoringTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + public virtual Pageable GetTrainingConfigVersions(TextAuthoringProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringTrainingConfigVersion.DeserializeTextAuthoringTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AuthoringClient.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); + } + + private TextAuthoringProjects _cachedTextAuthoringProjects; + private TextAuthoringDeployments _cachedTextAuthoringDeployments; + private TextAuthoringModels _cachedTextAuthoringModels; + + /// Initializes a new instance of TextAuthoringProjects. + public virtual TextAuthoringProjects GetTextAuthoringProjectsClient() + { + return Volatile.Read(ref _cachedTextAuthoringProjects) ?? Interlocked.CompareExchange(ref _cachedTextAuthoringProjects, new TextAuthoringProjects(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedTextAuthoringProjects; + } + + /// Initializes a new instance of TextAuthoringDeployments. + public virtual TextAuthoringDeployments GetTextAuthoringDeploymentsClient() + { + return Volatile.Read(ref _cachedTextAuthoringDeployments) ?? Interlocked.CompareExchange(ref _cachedTextAuthoringDeployments, new TextAuthoringDeployments(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedTextAuthoringDeployments; + } + + /// Initializes a new instance of TextAuthoringModels. + public virtual TextAuthoringModels GetTextAuthoringModelsClient() + { + return Volatile.Read(ref _cachedTextAuthoringModels) ?? Interlocked.CompareExchange(ref _cachedTextAuthoringModels, new TextAuthoringModels(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedTextAuthoringModels; + } + + internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/languages", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/training-config-versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + 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"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml deleted file mode 100644 index 9d6677f775eb..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml +++ /dev/null @@ -1,5789 +0,0 @@ - - - - - -This sample shows how to call GetProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync(""); -]]> -This sample shows how to call GetProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync(""); -]]> - - - -This sample shows how to call GetProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject(""); -]]> -This sample shows how to call GetProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject(""); -]]> - - - -This sample shows how to call GetProjectAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call GetProjectAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call GetProject and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call GetProject with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProject("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CreateProjectAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", -}); -Response response = await client.CreateProjectAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", -}); -Response response = await client.CreateProjectAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CreateProject and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", -}); -Response response = client.CreateProject("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> -This sample shows how to call CreateProject with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", -}); -Response response = client.CreateProject("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); -Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); -Console.WriteLine(result.GetProperty("projectName").ToString()); -Console.WriteLine(result.GetProperty("multilingual").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("language").ToString()); -]]> - - - -This sample shows how to call CopyProjectAuthorizationAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); -]]> -This sample shows how to call CopyProjectAuthorizationAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); -]]> - - - -This sample shows how to call CopyProjectAuthorization. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); -]]> -This sample shows how to call CopyProjectAuthorization with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); -]]> - - - -This sample shows how to call CopyProjectAuthorizationAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", -}); -Response response = await client.CopyProjectAuthorizationAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> -This sample shows how to call CopyProjectAuthorizationAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - allowOverwrite = true, -}); -Response response = await client.CopyProjectAuthorizationAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> - - - -This sample shows how to call CopyProjectAuthorization and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", -}); -Response response = client.CopyProjectAuthorization("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> -This sample shows how to call CopyProjectAuthorization with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - allowOverwrite = true, -}); -Response response = client.CopyProjectAuthorization("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("targetProjectName").ToString()); -Console.WriteLine(result.GetProperty("accessToken").ToString()); -Console.WriteLine(result.GetProperty("expiresAt").ToString()); -Console.WriteLine(result.GetProperty("targetResourceId").ToString()); -Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); -]]> - - - -This sample shows how to call GetCopyProjectStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", ""); -]]> -This sample shows how to call GetCopyProjectStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", ""); -]]> - - - -This sample shows how to call GetCopyProjectStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", ""); -]]> -This sample shows how to call GetCopyProjectStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", ""); -]]> - - - -This sample shows how to call GetCopyProjectStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetCopyProjectStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetCopyProjectStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetCopyProjectStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetCopyProjectStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetCopyProjectStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", ""); -]]> -This sample shows how to call GetDeploymentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", ""); -]]> - - - -This sample shows how to call GetDeployment. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", ""); -]]> -This sample shows how to call GetDeployment with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", ""); -]]> - - - -This sample shows how to call GetDeploymentAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> -This sample shows how to call GetDeploymentAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> - - - -This sample shows how to call GetDeployment and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> -This sample shows how to call GetDeployment with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeployment("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("deploymentName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); -Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); -Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentDeleteFromResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", ""); -]]> -This sample shows how to call GetDeploymentStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", ""); -]]> -This sample shows how to call GetDeploymentStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", ""); -]]> - - - -This sample shows how to call GetDeploymentStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetDeploymentStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetDeploymentStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetDeploymentStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetDeploymentStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", ""); -]]> -This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", ""); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", ""); -]]> -This sample shows how to call GetSwapDeploymentsStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", ""); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetSwapDeploymentsStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetSwapDeploymentsStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetSwapDeploymentsStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetExportStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", ""); -]]> -This sample shows how to call GetExportStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", ""); -]]> - - - -This sample shows how to call GetExportStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", ""); -]]> -This sample shows how to call GetExportStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", ""); -]]> - - - -This sample shows how to call GetExportStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("resultUrl").ToString()); -]]> - - - -This sample shows how to call GetExportStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("resultUrl").ToString()); -]]> - - - -This sample shows how to call GetExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", ""); -]]> -This sample shows how to call GetExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", ""); -]]> - - - -This sample shows how to call GetExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", ""); -]]> -This sample shows how to call GetExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", ""); -]]> - - - -This sample shows how to call GetExportedModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> -This sample shows how to call GetExportedModelAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> - - - -This sample shows how to call GetExportedModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> -This sample shows how to call GetExportedModel with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("exportedModelName").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -]]> - - - -This sample shows how to call GetExportedModelJobStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", ""); -]]> -This sample shows how to call GetExportedModelJobStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetExportedModelJobStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", ""); -]]> -This sample shows how to call GetExportedModelJobStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", ""); -]]> - - - -This sample shows how to call GetExportedModelJobStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportedModelJobStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetExportedModelJobStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetExportedModelJobStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelJobStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetExportedModelManifestAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelManifestAsync("", ""); -]]> -This sample shows how to call GetExportedModelManifestAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelManifestAsync("", ""); -]]> - - - -This sample shows how to call GetExportedModelManifest. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelManifest("", ""); -]]> -This sample shows how to call GetExportedModelManifest with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelManifest("", ""); -]]> - - - -This sample shows how to call GetExportedModelManifestAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelManifestAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); -]]> -This sample shows how to call GetExportedModelManifestAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetExportedModelManifestAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); -]]> - - - -This sample shows how to call GetExportedModelManifest and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelManifest("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); -]]> -This sample shows how to call GetExportedModelManifest with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetExportedModelManifest("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); -]]> - - - -This sample shows how to call GetImportStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", ""); -]]> -This sample shows how to call GetImportStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", ""); -]]> - - - -This sample shows how to call GetImportStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", ""); -]]> -This sample shows how to call GetImportStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", ""); -]]> - - - -This sample shows how to call GetImportStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetImportStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetImportStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetImportStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetImportStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetImportStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetTrainedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", ""); -]]> -This sample shows how to call GetTrainedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", ""); -]]> - - - -This sample shows how to call GetTrainedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", ""); -]]> -This sample shows how to call GetTrainedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", ""); -]]> - - - -This sample shows how to call GetTrainedModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> -This sample shows how to call GetTrainedModelAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainedModelAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> - - - -This sample shows how to call GetTrainedModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> -This sample shows how to call GetTrainedModel with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainedModel("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("label").ToString()); -Console.WriteLine(result.GetProperty("modelId").ToString()); -Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); -Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -]]> - - - -This sample shows how to call DeleteTrainedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.DeleteTrainedModelAsync("", ""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteTrainedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.DeleteTrainedModelAsync("", ""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call DeleteTrainedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.DeleteTrainedModel("", ""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call DeleteTrainedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.DeleteTrainedModel("", ""); - -Console.WriteLine(response.Status); -]]> - - - -This sample shows how to call GetEvaluationStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", ""); -]]> -This sample shows how to call GetEvaluationStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetEvaluationStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", ""); -]]> -This sample shows how to call GetEvaluationStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", ""); -]]> - - - -This sample shows how to call GetEvaluationStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call GetEvaluationStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetEvaluationStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call GetEvaluationStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call GetEvaluationStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetEvaluationStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call GetModelEvaluationSummaryAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", ""); -]]> -This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", ""); -]]> - - - -This sample shows how to call GetModelEvaluationSummary. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", ""); -]]> -This sample shows how to call GetModelEvaluationSummary with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", ""); -]]> - - - -This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -]]> -This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -]]> - - - -This sample shows how to call GetModelEvaluationSummary and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -]]> -This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetModelEvaluationSummary("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("projectKind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -]]> - - - -This sample shows how to call GetLoadSnapshotStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); -]]> -This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); -]]> - - - -This sample shows how to call GetLoadSnapshotStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", ""); -]]> -This sample shows how to call GetLoadSnapshotStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", ""); -]]> - - - -This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetLoadSnapshotStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetLoadSnapshotStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetLoadSnapshotStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetLoadSnapshotStatus("", "", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", ""); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", ""); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetAssignDeploymentResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", ""); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", ""); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetUnassignDeploymentResourcesStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetTrainingStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", ""); -]]> -This sample shows how to call GetTrainingStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", ""); -]]> - - - -This sample shows how to call GetTrainingStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", ""); -]]> -This sample shows how to call GetTrainingStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", ""); -]]> - - - -This sample shows how to call GetTrainingStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call GetTrainingStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetTrainingStatusAsync("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call GetTrainingStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call GetTrainingStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetTrainingStatus("", "", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call GetProjectDeletionStatusAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync(""); -]]> -This sample shows how to call GetProjectDeletionStatusAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync(""); -]]> - - - -This sample shows how to call GetProjectDeletionStatus. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus(""); -]]> -This sample shows how to call GetProjectDeletionStatus with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus(""); -]]> - - - -This sample shows how to call GetProjectDeletionStatusAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetProjectDeletionStatusAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = await client.GetProjectDeletionStatusAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetProjectDeletionStatus and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -]]> -This sample shows how to call GetProjectDeletionStatus with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Response response = client.GetProjectDeletionStatus("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("jobId").ToString()); -Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); -Console.WriteLine(result.GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); -Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); -]]> - - - -This sample shows how to call GetProjectsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectMetadata item in client.GetProjectsAsync()) -{ -} -]]> -This sample shows how to call GetProjectsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetProjects. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectMetadata item in client.GetProjects()) -{ -} -]]> -This sample shows how to call GetProjects with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetProjectsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetProjectsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetProjects and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetProjects(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetProjects with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) -{ -} -]]> -This sample shows how to call GetDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectDeployment item in client.GetDeployments("")) -{ -} -]]> -This sample shows how to call GetDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetDeployments and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeployments with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetExportedModelsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) -{ -} -]]> -This sample shows how to call GetExportedModelsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetExportedModels. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ExportedTrainedModel item in client.GetExportedModels("")) -{ -} -]]> -This sample shows how to call GetExportedModels with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetExportedModelsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> -This sample shows how to call GetExportedModelsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> - - - -This sample shows how to call GetExportedModels and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> -This sample shows how to call GetExportedModels with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); -} -]]> - - - -This sample shows how to call GetTrainedModelsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) -{ -} -]]> -This sample shows how to call GetTrainedModelsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainedModels. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectTrainedModel item in client.GetTrainedModels("")) -{ -} -]]> -This sample shows how to call GetTrainedModels with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainedModelsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> -This sample shows how to call GetTrainedModelsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> - - - -This sample shows how to call GetTrainedModels and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> -This sample shows how to call GetTrainedModels with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); -} -]]> - - - -This sample shows how to call GetModelEvaluationResultsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) -{ -} -]]> -This sample shows how to call GetModelEvaluationResultsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetModelEvaluationResults. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) -{ -} -]]> -This sample shows how to call GetModelEvaluationResults with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetModelEvaluationResultsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetModelEvaluationResults and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> -This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) -{ -} -]]> -This sample shows how to call GetDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) -{ -} -]]> -This sample shows how to call GetDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetDeploymentResourcesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentResourcesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetDeploymentResources and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> -This sample shows how to call GetDeploymentResources with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingJobsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) -{ -} -]]> -This sample shows how to call GetTrainingJobsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingJobs. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingJobState item in client.GetTrainingJobs("")) -{ -} -]]> -This sample shows how to call GetTrainingJobs with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingJobsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -} -]]> -This sample shows how to call GetTrainingJobsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingJobs and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); -} -]]> -This sample shows how to call GetTrainingJobs with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); -} -]]> - - - -This sample shows how to call GetAssignedResourceDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) -{ -} -]]> -This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetAssignedResourceDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) -{ -} -]]> -This sample shows how to call GetAssignedResourceDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -} -]]> -This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -} -]]> - - - -This sample shows how to call GetAssignedResourceDeployments and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -} -]]> -This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); -} -]]> - - - -This sample shows how to call GetSupportedLanguagesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) -{ -} -]]> -This sample shows how to call GetSupportedLanguagesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetSupportedLanguages. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (SupportedLanguage item in client.GetSupportedLanguages()) -{ -} -]]> -This sample shows how to call GetSupportedLanguages with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetSupportedLanguagesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); -} -]]> -This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); -} -]]> - - - -This sample shows how to call GetSupportedLanguages and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); -} -]]> -This sample shows how to call GetSupportedLanguages with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); -} -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntitiesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) -{ -} -]]> -This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) -{ -} -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntities. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) -{ -} -]]> -This sample shows how to call GetSupportedPrebuiltEntities with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) -{ -} -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); -} -]]> -This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); -} -]]> - - - -This sample shows how to call GetSupportedPrebuiltEntities and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); -} -]]> -This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingConfigVersionsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) -{ -} -]]> -This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingConfigVersions. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) -{ -} -]]> -This sample shows how to call GetTrainingConfigVersions with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) -{ -} -]]> - - - -This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -} -]]> -This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -} -]]> - - - -This sample shows how to call GetTrainingConfigVersions and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -} -]]> -This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); -} -]]> - - - -This sample shows how to call DeleteProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); -]]> -This sample shows how to call DeleteProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); -]]> - - - -This sample shows how to call DeleteProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteProject(WaitUntil.Completed, ""); -]]> -This sample shows how to call DeleteProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteProject(WaitUntil.Completed, ""); -]]> - - - -This sample shows how to call CopyProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.CustomSingleLabelClassification, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call CopyProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.CustomSingleLabelClassification, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call CopyProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.CustomSingleLabelClassification, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = client.CopyProject(WaitUntil.Completed, "", body); -]]> -This sample shows how to call CopyProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CopyProjectDetails body = new CopyProjectDetails( -ProjectKind.CustomSingleLabelClassification, -"", -"", -DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), -"", -""); -Operation operation = client.CopyProject(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call CopyProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call CopyProjectAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call CopyProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = client.CopyProject(WaitUntil.Completed, "", content); -]]> -This sample shows how to call CopyProject with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", -}); -Operation operation = client.CopyProject(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call ExportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); -]]> -This sample shows how to call ExportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call Export. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); -]]> -This sample shows how to call Export with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call ExportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); -]]> -This sample shows how to call ExportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call Export. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); -]]> -This sample shows how to call Export with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); -]]> - - - -This sample shows how to call ImportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call ImportAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") -{ - Settings = new ProjectSettings - { - ConfidenceThreshold = 123.45F, - AmlProjectPath = "", - IsLabelingLocked = true, - RunGptPredictions = true, - GptPredictiveLookahead = 1234, - }, - Multilingual = true, - Description = "", -}) -{ - Assets = new ExportedCustomAbstractiveSummarizationProjectAssets - { - Documents = {new ExportedCustomAbstractiveSummarizationDocument("") - { - Location = "", - Language = "", - Dataset = "", - }}, - }, -}; -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); -]]> - - - -This sample shows how to call Import. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); -Operation operation = client.Import(WaitUntil.Completed, "", body); -]]> -This sample shows how to call Import with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") -{ - Settings = new ProjectSettings - { - ConfidenceThreshold = 123.45F, - AmlProjectPath = "", - IsLabelingLocked = true, - RunGptPredictions = true, - GptPredictiveLookahead = 1234, - }, - Multilingual = true, - Description = "", -}) -{ - Assets = new ExportedCustomAbstractiveSummarizationProjectAssets - { - Documents = {new ExportedCustomAbstractiveSummarizationDocument("") - { - Location = "", - Language = "", - Dataset = "", - }}, - }, -}; -Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); -]]> - - - -This sample shows how to call ImportAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }, -}); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call ImportAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - documents = new object[] - { - new - { - summaryLocation = "", - location = "", - language = "", - dataset = "", - } - }, - projectKind = "CustomAbstractiveSummarization", - }, -}); -Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); -]]> - - - -This sample shows how to call Import. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }, -}); -Operation operation = client.Import(WaitUntil.Completed, "", content); -]]> -This sample shows how to call Import with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - documents = new object[] - { - new - { - summaryLocation = "", - location = "", - language = "", - dataset = "", - } - }, - projectKind = "CustomAbstractiveSummarization", - }, -}); -Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); -]]> - - - -This sample shows how to call TrainAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", ""); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call TrainAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", "") -{ - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), -}; -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call Train. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", ""); -Operation operation = client.Train(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call Train with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -TrainingJobDetails body = new TrainingJobDetails("", "") -{ - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), -}; -Operation operation = client.Train(WaitUntil.Completed, "", body); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call TrainAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", -}); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call TrainAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - dataGenerationSettings = new - { - enableDataGeneration = true, - dataGenerationConnectionInfo = new - { - kind = "azureOpenAI", - resourceId = "", - deploymentName = "", - }, - }, -}); -Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call Train and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", -}); -Operation operation = client.Train(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call Train with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - modelLabel = "", - trainingConfigVersion = "", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - dataGenerationSettings = new - { - enableDataGeneration = true, - dataGenerationConnectionInfo = new - { - kind = "azureOpenAI", - resourceId = "", - deploymentName = "", - }, - }, -}); -Operation operation = client.Train(WaitUntil.Completed, "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call DeployProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails(""); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeployProjectAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails("") -{ - AssignedResourceIds = { "" }, -}; -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeployProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails(""); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeployProject with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -CreateDeploymentDetails body = new CreateDeploymentDetails("") -{ - AssignedResourceIds = { "" }, -}; -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeployProjectAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeployProjectAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeployProject. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeployProject with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeleteDeploymentAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteDeploymentAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteDeployment. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteDeployment with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteDeploymentFromResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails(); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails -{ - AssignedResourceIds = { "" }, -}; -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeleteDeploymentFromResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails(); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call DeleteDeploymentFromResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -DeleteDeploymentDetails body = new DeleteDeploymentDetails -{ - AssignedResourceIds = { "" }, -}; -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call DeleteDeploymentFromResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeleteDeploymentFromResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call DeleteDeploymentFromResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call SwapDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call SwapDeploymentsAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call SwapDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); -]]> -This sample shows how to call SwapDeployments with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call SwapDeploymentsAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call SwapDeploymentsAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call SwapDeployments. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); -]]> -This sample shows how to call SwapDeployments with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - firstDeploymentName = "", - secondDeploymentName = "", -}); -Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); -]]> -This sample shows how to call CreateOrUpdateExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -ExportedModelDetails body = new ExportedModelDetails(""); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call CreateOrUpdateExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); -]]> -This sample shows how to call CreateOrUpdateExportedModel with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - trainedModelLabel = "", -}); -Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); -]]> - - - -This sample shows how to call DeleteExportedModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteExportedModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call DeleteExportedModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call DeleteExportedModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call EvaluateModelAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails(); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> -This sample shows how to call EvaluateModelAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails -{ - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, -}; -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call EvaluateModel. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails(); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> -This sample shows how to call EvaluateModel with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -EvaluationDetails body = new EvaluationDetails -{ - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, -}; -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); -EvaluationJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call EvaluateModelAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call EvaluateModelAsync with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, -}); -Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call EvaluateModel and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new object()); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> -This sample shows how to call EvaluateModel with all parameters and request content and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, -}); -Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("percentComplete").ToString()); -]]> - - - -This sample shows how to call LoadSnapshotAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call LoadSnapshotAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call LoadSnapshot. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); -]]> -This sample shows how to call LoadSnapshot with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); -]]> - - - -This sample shows how to call AssignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call AssignDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call AssignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); -]]> -This sample shows how to call AssignDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] -{ - new ResourceMetadata("", "", "") -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call AssignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call AssignDeploymentResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call AssignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); -]]> -This sample shows how to call AssignDeploymentResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - resourcesMetadata = new object[] - { - new - { - azureResourceId = "", - customDomain = "", - region = "", - } - }, -}); -Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call UnassignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> -This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call UnassignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); -]]> -This sample shows how to call UnassignDeploymentResources with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); -]]> - - - -This sample shows how to call UnassignDeploymentResourcesAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> -This sample shows how to call UnassignDeploymentResourcesAsync with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call UnassignDeploymentResources. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); -]]> -This sample shows how to call UnassignDeploymentResources with all parameters and request content. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -using RequestContent content = RequestContent.Create(new -{ - assignedResourceIds = new object[] - { - "" - }, -}); -Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); -]]> - - - -This sample shows how to call CancelTrainingJobAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call CancelTrainingJobAsync with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call CancelTrainingJob. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> -This sample shows how to call CancelTrainingJob with all parameters. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); -TrainingJobResult responseData = operation.Value; -]]> - - - -This sample shows how to call CancelTrainingJobAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call CancelTrainingJobAsync with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - -This sample shows how to call CancelTrainingJob and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -]]> -This sample shows how to call CancelTrainingJob with all parameters and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - -Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); -BinaryData responseData = operation.Value; - -JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; -Console.WriteLine(result.GetProperty("modelLabel").ToString()); -Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); -Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); -]]> - - - \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs deleted file mode 100644 index 2ee1a6c15cce..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The CompositionSetting. - public readonly partial struct CompositionSetting : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CompositionSetting(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SeparateComponentsValue = "separateComponents"; - private const string CombineComponentsValue = "combineComponents"; - - /// Every component's match or prediction is returned as a separate instance of the entity. - public static CompositionSetting SeparateComponents { get; } = new CompositionSetting(SeparateComponentsValue); - /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. - public static CompositionSetting CombineComponents { get; } = new CompositionSetting(CombineComponentsValue); - /// Determines if two values are the same. - public static bool operator ==(CompositionSetting left, CompositionSetting right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CompositionSetting left, CompositionSetting right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CompositionSetting(string value) => new CompositionSetting(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CompositionSetting other && Equals(other); - /// - public bool Equals(CompositionSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs deleted file mode 100644 index 130f76344bd0..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class ConfusionMatrix : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{format}' format."); - } - - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - - ConfusionMatrix IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrix(document.RootElement, options); - } - - internal static ConfusionMatrix DeserializeConfusionMatrix(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new ConfusionMatrix(additionalProperties); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{options.Format}' format."); - } - } - - ConfusionMatrix IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrix(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ConfusionMatrix FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrix(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs deleted file mode 100644 index 248f7077a849..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The ConfusionMatrixRow. - public partial class ConfusionMatrixRow - { - /// Initializes a new instance of . - internal ConfusionMatrixRow() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// Additional Properties. - internal ConfusionMatrixRow(IReadOnlyDictionary additionalProperties) - { - AdditionalProperties = additionalProperties; - } - - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// - /// Supported types: - /// - /// - /// - /// - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IReadOnlyDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs index f258f2a8eedf..286b29a58e08 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs @@ -83,7 +83,7 @@ internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizat { return null; } - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string storageInputContainerName = default; bool? allowOverwrite = default; IDictionary serializedAdditionalRawData = default; @@ -92,7 +92,7 @@ internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizat { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("storageInputContainerName"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs index 5082f591b1ea..e59f24c9c456 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -47,7 +47,7 @@ internal partial class CopyProjectAuthorizationRequest /// Initializes a new instance of . /// Represents the project kind. - internal CopyProjectAuthorizationRequest(ProjectKind projectKind) + internal CopyProjectAuthorizationRequest(TextAuthoringProjectKind projectKind) { ProjectKind = projectKind; } @@ -57,7 +57,7 @@ internal CopyProjectAuthorizationRequest(ProjectKind projectKind) /// The name of the storage container. /// Whether to allow an existing project to be overwritten using the resulting copy authorization. /// Keeps track of any properties unknown to the library. - internal CopyProjectAuthorizationRequest(ProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + internal CopyProjectAuthorizationRequest(TextAuthoringProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; StorageInputContainerName = storageInputContainerName; @@ -71,7 +71,7 @@ internal CopyProjectAuthorizationRequest() } /// Represents the project kind. - public ProjectKind ProjectKind { get; } + public TextAuthoringProjectKind ProjectKind { get; } /// The name of the storage container. public string StorageInputContainerName { get; } /// Whether to allow an existing project to be overwritten using the resulting copy authorization. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs index c44a091cde5e..0eb7e5b32f8e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs @@ -60,7 +60,7 @@ internal static CustomEntityRecognitionDocumentEvaluationResult DeserializeCusto return null; } DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -74,7 +74,7 @@ internal static CustomEntityRecognitionDocumentEvaluationResult DeserializeCusto } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs index 21e1cc79ba6f..1a8f2d8d544e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the document evaluation result for a custom entity recognition project. - public partial class CustomEntityRecognitionDocumentEvaluationResult : DocumentEvaluationResult + public partial class CustomEntityRecognitionDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { /// Initializes a new instance of . /// Represents the document path. @@ -24,7 +24,7 @@ internal CustomEntityRecognitionDocumentEvaluationResult(string location, string Argument.AssertNotNull(language, nameof(language)); Argument.AssertNotNull(customEntityRecognitionResult, nameof(customEntityRecognitionResult)); - ProjectKind = ProjectKind.CustomEntityRecognition; + ProjectKind = TextAuthoringProjectKind.CustomEntityRecognition; CustomEntityRecognitionResult = customEntityRecognitionResult; } @@ -34,7 +34,7 @@ internal CustomEntityRecognitionDocumentEvaluationResult(string location, string /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. /// Represents the evaluation prediction for entity recognition. - internal CustomEntityRecognitionDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(projectKind, location, language, serializedAdditionalRawData) + internal CustomEntityRecognitionDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(projectKind, location, language, serializedAdditionalRawData) { CustomEntityRecognitionResult = customEntityRecognitionResult; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs index 02086fc20371..546a8fe30fe1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs @@ -60,8 +60,8 @@ internal static CustomEntityRecognitionEvaluationSummary DeserializeCustomEntity return null; } EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = default; - ProjectKind projectKind = default; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = default; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -73,12 +73,12 @@ internal static CustomEntityRecognitionEvaluationSummary DeserializeCustomEntity } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs index af1ea805f081..44111a2749e4 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for a custom entity recognition project. - public partial class CustomEntityRecognitionEvaluationSummary : EvaluationSummary + public partial class CustomEntityRecognitionEvaluationSummary : TextAuthoringEvaluationSummary { /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to extraction evaluation. /// or is null. - internal CustomEntityRecognitionEvaluationSummary(EvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(evaluationOptions) + internal CustomEntityRecognitionEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(customEntityRecognitionEvaluation, nameof(customEntityRecognitionEvaluation)); - ProjectKind = ProjectKind.CustomEntityRecognition; + ProjectKind = TextAuthoringProjectKind.CustomEntityRecognition; CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; } @@ -31,7 +31,7 @@ internal CustomEntityRecognitionEvaluationSummary(EvaluationDetails evaluationOp /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. /// Contains the data related to extraction evaluation. - internal CustomEntityRecognitionEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal CustomEntityRecognitionEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs index 726a1d144e16..24d07f940fe5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs @@ -60,7 +60,7 @@ internal static CustomHealthcareDocumentEvaluationResult DeserializeCustomHealth return null; } DocumentHealthcareEvaluationResult customHealthcareResult = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -74,7 +74,7 @@ internal static CustomHealthcareDocumentEvaluationResult DeserializeCustomHealth } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs index f89d84726837..c76093db72ac 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the document evaluation result for a custom entity recognition project. - public partial class CustomHealthcareDocumentEvaluationResult : DocumentEvaluationResult + public partial class CustomHealthcareDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { /// Initializes a new instance of . /// Represents the document path. @@ -24,7 +24,7 @@ internal CustomHealthcareDocumentEvaluationResult(string location, string langua Argument.AssertNotNull(language, nameof(language)); Argument.AssertNotNull(customHealthcareResult, nameof(customHealthcareResult)); - ProjectKind = ProjectKind.CustomHealthcare; + ProjectKind = TextAuthoringProjectKind.CustomHealthcare; CustomHealthcareResult = customHealthcareResult; } @@ -34,7 +34,7 @@ internal CustomHealthcareDocumentEvaluationResult(string location, string langua /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. /// Represents the evaluation prediction for entity recognition. - internal CustomHealthcareDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentHealthcareEvaluationResult customHealthcareResult) : base(projectKind, location, language, serializedAdditionalRawData) + internal CustomHealthcareDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentHealthcareEvaluationResult customHealthcareResult) : base(projectKind, location, language, serializedAdditionalRawData) { CustomHealthcareResult = customHealthcareResult; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs index 02df1aaacae0..9eb7a8477df6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs @@ -60,8 +60,8 @@ internal static CustomHealthcareEvaluationSummary DeserializeCustomHealthcareEva return null; } EntityRecognitionEvaluationSummary customHealthcareEvaluation = default; - ProjectKind projectKind = default; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = default; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -73,12 +73,12 @@ internal static CustomHealthcareEvaluationSummary DeserializeCustomHealthcareEva } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs index b42fd9a30698..fcbe23d5892b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for a custom health care project. - public partial class CustomHealthcareEvaluationSummary : EvaluationSummary + public partial class CustomHealthcareEvaluationSummary : TextAuthoringEvaluationSummary { /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to health care evaluation. /// or is null. - internal CustomHealthcareEvaluationSummary(EvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(evaluationOptions) + internal CustomHealthcareEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(customHealthcareEvaluation, nameof(customHealthcareEvaluation)); - ProjectKind = ProjectKind.CustomHealthcare; + ProjectKind = TextAuthoringProjectKind.CustomHealthcare; CustomHealthcareEvaluation = customHealthcareEvaluation; } @@ -31,7 +31,7 @@ internal CustomHealthcareEvaluationSummary(EvaluationDetails evaluationOptions, /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. /// Contains the data related to health care evaluation. - internal CustomHealthcareEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal CustomHealthcareEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { CustomHealthcareEvaluation = customHealthcareEvaluation; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs index 242c6b8fb74c..f5a775641f5b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -60,7 +60,7 @@ internal static CustomMultiLabelClassificationDocumentEvaluationResult Deseriali return null; } DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -74,7 +74,7 @@ internal static CustomMultiLabelClassificationDocumentEvaluationResult Deseriali } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs index b313a7e7bf08..017d4c278997 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the document evaluation result for a custom multi-label classification project. - public partial class CustomMultiLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { /// Initializes a new instance of . /// Represents the document path. @@ -24,7 +24,7 @@ internal CustomMultiLabelClassificationDocumentEvaluationResult(string location, Argument.AssertNotNull(language, nameof(language)); Argument.AssertNotNull(customMultiLabelClassificationResult, nameof(customMultiLabelClassificationResult)); - ProjectKind = ProjectKind.CustomMultiLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomMultiLabelClassification; CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; } @@ -34,7 +34,7 @@ internal CustomMultiLabelClassificationDocumentEvaluationResult(string location, /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. /// Represents the evaluation prediction for multi label classification. - internal CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + internal CustomMultiLabelClassificationDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) { CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs index 95bcd9182059..3eebcf42ea93 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs @@ -60,8 +60,8 @@ internal static CustomMultiLabelClassificationEvaluationSummary DeserializeCusto return null; } MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = default; - ProjectKind projectKind = default; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = default; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -73,12 +73,12 @@ internal static CustomMultiLabelClassificationEvaluationSummary DeserializeCusto } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs index 89dfb90ee5bb..8deee06a753a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for a custom multi-label classification project. - public partial class CustomMultiLabelClassificationEvaluationSummary : EvaluationSummary + public partial class CustomMultiLabelClassificationEvaluationSummary : TextAuthoringEvaluationSummary { /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to multi label classification evaluation. /// or is null. - internal CustomMultiLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(evaluationOptions) + internal CustomMultiLabelClassificationEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(customMultiLabelClassificationEvaluation, nameof(customMultiLabelClassificationEvaluation)); - ProjectKind = ProjectKind.CustomMultiLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomMultiLabelClassification; CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; } @@ -31,7 +31,7 @@ internal CustomMultiLabelClassificationEvaluationSummary(EvaluationDetails evalu /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. /// Contains the data related to multi label classification evaluation. - internal CustomMultiLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal CustomMultiLabelClassificationEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs index 57861eb5a1b5..3bd289ac018b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -60,7 +60,7 @@ internal static CustomSingleLabelClassificationDocumentEvaluationResult Deserial return null; } DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -74,7 +74,7 @@ internal static CustomSingleLabelClassificationDocumentEvaluationResult Deserial } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs index 5bae1e7e6c4c..909a0a2979a9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the document evaluation result for a custom single-label classification project. - public partial class CustomSingleLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { /// Initializes a new instance of . /// Represents the document path. @@ -24,7 +24,7 @@ internal CustomSingleLabelClassificationDocumentEvaluationResult(string location Argument.AssertNotNull(language, nameof(language)); Argument.AssertNotNull(customSingleLabelClassificationResult, nameof(customSingleLabelClassificationResult)); - ProjectKind = ProjectKind.CustomSingleLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomSingleLabelClassification; CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; } @@ -34,7 +34,7 @@ internal CustomSingleLabelClassificationDocumentEvaluationResult(string location /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. /// Represents the evaluation prediction for single label classification. - internal CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + internal CustomSingleLabelClassificationDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) { CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs index 06c9c7209461..0e75d0d3c397 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs @@ -60,8 +60,8 @@ internal static CustomSingleLabelClassificationEvaluationSummary DeserializeCust return null; } SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = default; - ProjectKind projectKind = default; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = default; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -73,12 +73,12 @@ internal static CustomSingleLabelClassificationEvaluationSummary DeserializeCust } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs index 01cb6675593c..947f3434bc10 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for a custom single-label classification project. - public partial class CustomSingleLabelClassificationEvaluationSummary : EvaluationSummary + public partial class CustomSingleLabelClassificationEvaluationSummary : TextAuthoringEvaluationSummary { /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to single label classification evaluation. /// or is null. - internal CustomSingleLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(evaluationOptions) + internal CustomSingleLabelClassificationEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(customSingleLabelClassificationEvaluation, nameof(customSingleLabelClassificationEvaluation)); - ProjectKind = ProjectKind.CustomSingleLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomSingleLabelClassification; CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; } @@ -31,7 +31,7 @@ internal CustomSingleLabelClassificationEvaluationSummary(EvaluationDetails eval /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. /// Contains the data related to single label classification evaluation. - internal CustomSingleLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal CustomSingleLabelClassificationEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs index 60121f8ea4a9..f1dd4244c360 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs @@ -60,7 +60,7 @@ internal static CustomTextSentimentDocumentEvaluationResult DeserializeCustomTex return null; } DocumentTextSentimentEvaluationResult customTextSentimentResult = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -74,7 +74,7 @@ internal static CustomTextSentimentDocumentEvaluationResult DeserializeCustomTex } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs index ab07896bc858..3e62df72cceb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the document evaluation result for a custom sentiment project. - public partial class CustomTextSentimentDocumentEvaluationResult : DocumentEvaluationResult + public partial class CustomTextSentimentDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { /// Initializes a new instance of . /// Represents the document path. @@ -24,7 +24,7 @@ internal CustomTextSentimentDocumentEvaluationResult(string location, string lan Argument.AssertNotNull(language, nameof(language)); Argument.AssertNotNull(customTextSentimentResult, nameof(customTextSentimentResult)); - ProjectKind = ProjectKind.CustomTextSentiment; + ProjectKind = TextAuthoringProjectKind.CustomTextSentiment; CustomTextSentimentResult = customTextSentimentResult; } @@ -34,7 +34,7 @@ internal CustomTextSentimentDocumentEvaluationResult(string location, string lan /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. /// Represents the evaluation prediction for text sentiment. - internal CustomTextSentimentDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(projectKind, location, language, serializedAdditionalRawData) + internal CustomTextSentimentDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(projectKind, location, language, serializedAdditionalRawData) { CustomTextSentimentResult = customTextSentimentResult; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs index 4946c6b8b920..e1efc0cc3319 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs @@ -60,8 +60,8 @@ internal static CustomTextSentimentEvaluationSummary DeserializeCustomTextSentim return null; } TextSentimentEvaluationSummary customTextSentimentEvaluation = default; - ProjectKind projectKind = default; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = default; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -73,12 +73,12 @@ internal static CustomTextSentimentEvaluationSummary DeserializeCustomTextSentim } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs index 8c2df398ef37..05333c269438 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for a custom text sentiment project. - public partial class CustomTextSentimentEvaluationSummary : EvaluationSummary + public partial class CustomTextSentimentEvaluationSummary : TextAuthoringEvaluationSummary { /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to custom sentiment evaluation. /// or is null. - internal CustomTextSentimentEvaluationSummary(EvaluationDetails evaluationOptions, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(evaluationOptions) + internal CustomTextSentimentEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(customTextSentimentEvaluation, nameof(customTextSentimentEvaluation)); - ProjectKind = ProjectKind.CustomTextSentiment; + ProjectKind = TextAuthoringProjectKind.CustomTextSentiment; CustomTextSentimentEvaluation = customTextSentimentEvaluation; } @@ -31,7 +31,7 @@ internal CustomTextSentimentEvaluationSummary(EvaluationDetails evaluationOption /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. /// Contains the data related to custom sentiment evaluation. - internal CustomTextSentimentEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal CustomTextSentimentEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { CustomTextSentimentEvaluation = customTextSentimentEvaluation; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.Serialization.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.Serialization.cs index 29705c0072cb..26440a5eeb73 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomTextSentimentProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class CustomTextSentimentProjectAssets : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(CustomTextSentimentProjectAssets)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -47,19 +47,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomTextSentimentProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CustomTextSentimentProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(CustomTextSentimentProjectAssets)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + return DeserializeCustomTextSentimentProjectAssets(document.RootElement, options); } - internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCustomTextSentimentProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static CustomTextSentimentProjectAssets DeserializeCustomTextSentimentProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -68,7 +68,7 @@ internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCust return null; } IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -89,7 +89,7 @@ internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCust } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -98,46 +98,46 @@ internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCust } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomTextSentimentProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + return new CustomTextSentimentProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(CustomTextSentimentProjectAssets)} does not support writing '{options.Format}' format."); } } - ExportedCustomTextSentimentProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + CustomTextSentimentProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + return DeserializeCustomTextSentimentProjectAssets(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(CustomTextSentimentProjectAssets)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomTextSentimentProjectAssets FromResponse(Response response) + internal static new CustomTextSentimentProjectAssets FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement); + return DeserializeCustomTextSentimentProjectAssets(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.cs similarity index 57% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.cs index 212043139c9a..f4c4cf9298d0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentProjectAssets.cs @@ -11,20 +11,20 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for a custom text sentiment project. - public partial class ExportedCustomTextSentimentProjectAssets : ExportedProjectAssets + public partial class CustomTextSentimentProjectAssets : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomTextSentimentProjectAssets() + /// Initializes a new instance of . + public CustomTextSentimentProjectAssets() { - ProjectKind = ProjectKind.CustomTextSentiment; + ProjectKind = TextAuthoringProjectKind.CustomTextSentiment; Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of documents belonging to the project. - internal ExportedCustomTextSentimentProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + internal CustomTextSentimentProjectAssets(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) { Documents = documents; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.Serialization.cs index 02b4ca7c8475..2a1b3aba87c6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DataGenerationSettings : IUtf8JsonSerializable, IJsonModel + public partial class DataGenerationSetting : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DataGenerationSetting)} does not support writing '{format}' format."); } writer.WritePropertyName("enableDataGeneration"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataGenerationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataGenerationSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DataGenerationSetting)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataGenerationSettings(document.RootElement, options); + return DeserializeDataGenerationSetting(document.RootElement, options); } - internal static DataGenerationSettings DeserializeDataGenerationSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static DataGenerationSetting DeserializeDataGenerationSetting(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static DataGenerationSettings DeserializeDataGenerationSettings(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new DataGenerationSettings(enableDataGeneration, dataGenerationConnectionInfo, serializedAdditionalRawData); + return new DataGenerationSetting(enableDataGeneration, dataGenerationConnectionInfo, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataGenerationSetting)} does not support writing '{options.Format}' format."); } } - DataGenerationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DataGenerationSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataGenerationSettings(document.RootElement, options); + return DeserializeDataGenerationSetting(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DataGenerationSetting)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DataGenerationSettings FromResponse(Response response) + internal static DataGenerationSetting FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDataGenerationSettings(document.RootElement); + return DeserializeDataGenerationSetting(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.cs similarity index 87% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.cs index ec47c688c67e..a12524564d3a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSetting.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the settings for using data generation as part of training a custom model. - public partial class DataGenerationSettings + public partial class DataGenerationSetting { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class DataGenerationSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// If set to true, augment customer provided training data with synthetic data to improve model quality. /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. /// is null. - public DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo) + public DataGenerationSetting(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo) { Argument.AssertNotNull(dataGenerationConnectionInfo, nameof(dataGenerationConnectionInfo)); @@ -57,19 +57,19 @@ public DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectio DataGenerationConnectionInfo = dataGenerationConnectionInfo; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// If set to true, augment customer provided training data with synthetic data to improve model quality. /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. /// Keeps track of any properties unknown to the library. - internal DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo, IDictionary serializedAdditionalRawData) + internal DataGenerationSetting(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo, IDictionary serializedAdditionalRawData) { EnableDataGeneration = enableDataGeneration; DataGenerationConnectionInfo = dataGenerationConnectionInfo; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataGenerationSettings() + /// Initializes a new instance of for deserialization. + internal DataGenerationSetting() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs index 6331cb3ab415..207a817fdfac 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs @@ -77,7 +77,7 @@ internal static DocumentSentimentLabelEvaluationResult DeserializeDocumentSentim { return null; } - TextAnalysisAuthoringSentiment category = default; + TextAuthoringSentiment category = default; int offset = default; int length = default; IDictionary serializedAdditionalRawData = default; @@ -86,7 +86,7 @@ internal static DocumentSentimentLabelEvaluationResult DeserializeDocumentSentim { if (property.NameEquals("category"u8)) { - category = new TextAnalysisAuthoringSentiment(property.Value.GetString()); + category = new TextAuthoringSentiment(property.Value.GetString()); continue; } if (property.NameEquals("offset"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs index ca2ed6833c38..208a6d0eeff9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs @@ -49,7 +49,7 @@ public partial class DocumentSentimentLabelEvaluationResult /// Represents the sentiment category. /// Represents the sentiment offset index relative to the original text. /// Represents the sentiment length. - internal DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category, int offset, int length) + internal DocumentSentimentLabelEvaluationResult(TextAuthoringSentiment category, int offset, int length) { Category = category; Offset = offset; @@ -61,7 +61,7 @@ internal DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment c /// Represents the sentiment offset index relative to the original text. /// Represents the sentiment length. /// Keeps track of any properties unknown to the library. - internal DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category, int offset, int length, IDictionary serializedAdditionalRawData) + internal DocumentSentimentLabelEvaluationResult(TextAuthoringSentiment category, int offset, int length, IDictionary serializedAdditionalRawData) { Category = category; Offset = offset; @@ -75,7 +75,7 @@ internal DocumentSentimentLabelEvaluationResult() } /// Represents the sentiment category. - public TextAnalysisAuthoringSentiment Category { get; } + public TextAuthoringSentiment Category { get; } /// Represents the sentiment offset index relative to the original text. public int Offset { get; } /// Represents the sentiment length. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs index 6ba8e6fbc90d..e69c7dec1bb3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs @@ -35,7 +35,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("confusionMatrix"u8); - writer.WriteObjectValue(ConfusionMatrix, options); + writer.WriteStartObject(); + foreach (var item in ConfusionMatrix) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); writer.WritePropertyName("entities"u8); writer.WriteStartObject(); foreach (var item in Entities) @@ -93,8 +99,8 @@ internal static EntityRecognitionEvaluationSummary DeserializeEntityRecognitionE { return null; } - ConfusionMatrix confusionMatrix = default; - IReadOnlyDictionary entities = default; + IReadOnlyDictionary confusionMatrix = default; + IReadOnlyDictionary entities = default; float microF1 = default; float microPrecision = default; float microRecall = default; @@ -107,15 +113,20 @@ internal static EntityRecognitionEvaluationSummary DeserializeEntityRecognitionE { if (property.NameEquals("confusionMatrix"u8)) { - confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, TextAuthoringConfusionMatrixRow.DeserializeTextAuthoringConfusionMatrixRow(property0.Value, options)); + } + confusionMatrix = dictionary; continue; } if (property.NameEquals("entities"u8)) { - Dictionary dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, EntityEvaluationSummary.DeserializeEntityEvaluationSummary(property0.Value, options)); + dictionary.Add(property0.Name, TextAuthoringEntityEvaluationSummary.DeserializeTextAuthoringEntityEvaluationSummary(property0.Value, options)); } entities = dictionary; continue; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs index d397bd5cbc09..43a3cec4cf63 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs @@ -55,7 +55,7 @@ public partial class EntityRecognitionEvaluationSummary /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// or is null. - internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + internal EntityRecognitionEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) { Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); Argument.AssertNotNull(entities, nameof(entities)); @@ -80,7 +80,7 @@ internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IRe /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + internal EntityRecognitionEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) { ConfusionMatrix = confusionMatrix; Entities = entities; @@ -99,9 +99,9 @@ internal EntityRecognitionEvaluationSummary() } /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. - public ConfusionMatrix ConfusionMatrix { get; } + public IReadOnlyDictionary ConfusionMatrix { get; } /// Represents the entities evaluation. - public IReadOnlyDictionary Entities { get; } + public IReadOnlyDictionary Entities { get; } /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. public float MicroF1 { get; } /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs deleted file mode 100644 index b25c560b3483..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// Human-readable error code. - public readonly partial struct ErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidRequestValue = "InvalidRequest"; - private const string InvalidArgumentValue = "InvalidArgument"; - private const string UnauthorizedValue = "Unauthorized"; - private const string ForbiddenValue = "Forbidden"; - private const string NotFoundValue = "NotFound"; - private const string ProjectNotFoundValue = "ProjectNotFound"; - private const string OperationNotFoundValue = "OperationNotFound"; - private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; - private const string AzureCognitiveSearchIndexNotFoundValue = "AzureCognitiveSearchIndexNotFound"; - private const string TooManyRequestsValue = "TooManyRequests"; - private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; - private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached"; - private const string InternalServerErrorValue = "InternalServerError"; - private const string ServiceUnavailableValue = "ServiceUnavailable"; - private const string TimeoutValue = "Timeout"; - private const string QuotaExceededValue = "QuotaExceeded"; - private const string ConflictValue = "Conflict"; - private const string WarningValue = "Warning"; - - /// InvalidRequest. - public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue); - /// InvalidArgument. - public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue); - /// Unauthorized. - public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue); - /// Forbidden. - public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue); - /// NotFound. - public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue); - /// ProjectNotFound. - public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue); - /// OperationNotFound. - public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue); - /// AzureCognitiveSearchNotFound. - public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue); - /// AzureCognitiveSearchIndexNotFound. - public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue); - /// TooManyRequests. - public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue); - /// AzureCognitiveSearchThrottling. - public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue); - /// AzureCognitiveSearchIndexLimitReached. - public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue); - /// InternalServerError. - public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue); - /// ServiceUnavailable. - public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue); - /// Timeout. - public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue); - /// QuotaExceeded. - public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue); - /// Conflict. - public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue); - /// Warning. - public static ErrorCode Warning { get; } = new ErrorCode(WarningValue); - /// Determines if two values are the same. - public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ErrorCode left, ErrorCode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ErrorCode(string value) => new ErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ErrorCode other && Equals(other); - /// - public bool Equals(ErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs deleted file mode 100644 index 6cd9bbab3779..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The EvaluationKind. - public readonly partial struct EvaluationKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EvaluationKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PercentageValue = "percentage"; - private const string ManualValue = "manual"; - - /// Split the data into training and test sets according to user-defined percentages. - public static EvaluationKind Percentage { get; } = new EvaluationKind(PercentageValue); - /// Split the data according to the chosen dataset for every example in the data. - public static EvaluationKind Manual { get; } = new EvaluationKind(ManualValue); - /// Determines if two values are the same. - public static bool operator ==(EvaluationKind left, EvaluationKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EvaluationKind left, EvaluationKind right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EvaluationKind(string value) => new EvaluationKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EvaluationKind other && Equals(other); - /// - public bool Equals(EvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs index 5e806b73d13a..4e49f7fe7938 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs @@ -96,9 +96,9 @@ internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonE { return null; } - CompositionSetting? compositionSetting = default; - ExportedEntityList list = default; - IList prebuilts = default; + TextAuthoringCompositionMode? compositionSetting = default; + TextAuthoringExportedEntityList list = default; + IList prebuilts = default; string category = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -110,7 +110,7 @@ internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonE { continue; } - compositionSetting = new CompositionSetting(property.Value.GetString()); + compositionSetting = new TextAuthoringCompositionMode(property.Value.GetString()); continue; } if (property.NameEquals("list"u8)) @@ -119,7 +119,7 @@ internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonE { continue; } - list = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); + list = TextAuthoringExportedEntityList.DeserializeTextAuthoringExportedEntityList(property.Value, options); continue; } if (property.NameEquals("prebuilts"u8)) @@ -128,10 +128,10 @@ internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ExportedPrebuiltEntity.DeserializeExportedPrebuiltEntity(item, options)); + array.Add(TextAuthoringExportedPrebuiltEntity.DeserializeTextAuthoringExportedPrebuiltEntity(item, options)); } prebuilts = array; continue; @@ -147,7 +147,7 @@ internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCompositeEntity(compositionSetting, list, prebuilts ?? new ChangeTrackingList(), category, serializedAdditionalRawData); + return new ExportedCompositeEntity(compositionSetting, list, prebuilts ?? new ChangeTrackingList(), category, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs index d48e0060c13c..f3b9e8794b0a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs @@ -48,7 +48,7 @@ public partial class ExportedCompositeEntity /// Initializes a new instance of . public ExportedCompositeEntity() { - Prebuilts = new ChangeTrackingList(); + Prebuilts = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -57,7 +57,7 @@ public ExportedCompositeEntity() /// The prebuilt entities components. /// The entity category. /// Keeps track of any properties unknown to the library. - internal ExportedCompositeEntity(CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, string category, IDictionary serializedAdditionalRawData) + internal ExportedCompositeEntity(TextAuthoringCompositionMode? compositionSetting, TextAuthoringExportedEntityList list, IList prebuilts, string category, IDictionary serializedAdditionalRawData) { CompositionSetting = compositionSetting; List = list; @@ -67,11 +67,11 @@ internal ExportedCompositeEntity(CompositionSetting? compositionSetting, Exporte } /// The behavior to follow when the entity's components overlap with each other. - public CompositionSetting? CompositionSetting { get; set; } + public TextAuthoringCompositionMode? CompositionSetting { get; set; } /// The list component of the entity. - public ExportedEntityList List { get; set; } + public TextAuthoringExportedEntityList List { get; set; } /// The prebuilt entities components. - public IList Prebuilts { get; } + public IList Prebuilts { get; } /// The entity category. public string Category { get; set; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.Serialization.cs index 8130c91d17a0..4cc84d479c21 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomAbstractiveSummarizationProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ExportedCustomAbstractiveSummarizationProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8J /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -47,19 +47,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomAbstractiveSummarizationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedCustomAbstractiveSummarizationProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomAbstractiveSummarizationProjectAsset(document.RootElement, options); } - internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeExportedCustomAbstractiveSummarizationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedCustomAbstractiveSummarizationProjectAsset DeserializeExportedCustomAbstractiveSummarizationProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -68,7 +68,7 @@ internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeE return null; } IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -89,7 +89,7 @@ internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeE } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -98,46 +98,46 @@ internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeE } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomAbstractiveSummarizationProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + return new ExportedCustomAbstractiveSummarizationProjectAsset(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedCustomAbstractiveSummarizationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedCustomAbstractiveSummarizationProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomAbstractiveSummarizationProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomAbstractiveSummarizationProjectAssets FromResponse(Response response) + internal static new ExportedCustomAbstractiveSummarizationProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement); + return DeserializeExportedCustomAbstractiveSummarizationProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.cs index f6b5213b4f13..1e189d4ec68e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAsset.cs @@ -11,20 +11,20 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for an abstractive summarization project. - public partial class ExportedCustomAbstractiveSummarizationProjectAssets : ExportedProjectAssets + public partial class ExportedCustomAbstractiveSummarizationProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomAbstractiveSummarizationProjectAssets() + /// Initializes a new instance of . + public ExportedCustomAbstractiveSummarizationProjectAsset() { - ProjectKind = ProjectKind.CustomAbstractiveSummarization; + ProjectKind = TextAuthoringProjectKind.CustomAbstractiveSummarization; Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of documents belonging to this project. - internal ExportedCustomAbstractiveSummarizationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + internal ExportedCustomAbstractiveSummarizationProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) { Documents = documents; } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.Serialization.cs index e29002a15116..e9bec6ef70b6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomEntityRecognitionProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ExportedCustomEntityRecognitionProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -57,19 +57,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomEntityRecognitionProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedCustomEntityRecognitionProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + return DeserializeExportedCustomEntityRecognitionProjectAsset(document.RootElement, options); } - internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExportedCustomEntityRecognitionProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedCustomEntityRecognitionProjectAsset DeserializeExportedCustomEntityRecognitionProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,9 +77,9 @@ internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExported { return null; } - IList entities = default; + IList entities = default; IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,10 +90,10 @@ internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExported { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ExportedEntity.DeserializeExportedEntity(item, options)); + array.Add(TextAuthoringExportedEntity.DeserializeTextAuthoringExportedEntity(item, options)); } entities = array; continue; @@ -114,7 +114,7 @@ internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExported } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -123,46 +123,46 @@ internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExported } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomEntityRecognitionProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + return new ExportedCustomEntityRecognitionProjectAsset(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedCustomEntityRecognitionProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedCustomEntityRecognitionProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + return DeserializeExportedCustomEntityRecognitionProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomEntityRecognitionProjectAssets FromResponse(Response response) + internal static new ExportedCustomEntityRecognitionProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement); + return DeserializeExportedCustomEntityRecognitionProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.cs index 15b8b18d382b..7ce02931339a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAsset.cs @@ -11,29 +11,29 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for a entity recognition project. - public partial class ExportedCustomEntityRecognitionProjectAssets : ExportedProjectAssets + public partial class ExportedCustomEntityRecognitionProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomEntityRecognitionProjectAssets() + /// Initializes a new instance of . + public ExportedCustomEntityRecognitionProjectAsset() { - ProjectKind = ProjectKind.CustomEntityRecognition; - Entities = new ChangeTrackingList(); + ProjectKind = TextAuthoringProjectKind.CustomEntityRecognition; + Entities = new ChangeTrackingList(); Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of entities belonging to the project. /// The list of documents belonging to the project. - internal ExportedCustomEntityRecognitionProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + internal ExportedCustomEntityRecognitionProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) { Entities = entities; Documents = documents; } /// The list of entities belonging to the project. - public IList Entities { get; } + public IList Entities { get; } /// The list of documents belonging to the project. public IList Documents { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.Serialization.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.Serialization.cs index 5484989b5b82..11d7e8db2764 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomHealthcareProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ExportedCustomHealthcareProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -57,19 +57,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomHealthcareProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedCustomHealthcareProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + return DeserializeExportedCustomHealthcareProjectAsset(document.RootElement, options); } - internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomHealthcareProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedCustomHealthcareProjectAsset DeserializeExportedCustomHealthcareProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomH } IList entities = default; IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,7 +114,7 @@ internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomH } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -123,46 +123,46 @@ internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomH } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomHealthcareProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + return new ExportedCustomHealthcareProjectAsset(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedCustomHealthcareProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedCustomHealthcareProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + return DeserializeExportedCustomHealthcareProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomHealthcareProjectAssets FromResponse(Response response) + internal static new ExportedCustomHealthcareProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement); + return DeserializeExportedCustomHealthcareProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.cs index 9556e1cea497..1fcc916676e9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAsset.cs @@ -11,22 +11,22 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for a CustomHealthcare project. - public partial class ExportedCustomHealthcareProjectAssets : ExportedProjectAssets + public partial class ExportedCustomHealthcareProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomHealthcareProjectAssets() + /// Initializes a new instance of . + public ExportedCustomHealthcareProjectAsset() { - ProjectKind = ProjectKind.CustomHealthcare; + ProjectKind = TextAuthoringProjectKind.CustomHealthcare; Entities = new ChangeTrackingList(); Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of entities belonging to the project. /// The list of documents belonging to the project. - internal ExportedCustomHealthcareProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + internal ExportedCustomHealthcareProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) { Entities = entities; Documents = documents; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.Serialization.cs similarity index 73% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.Serialization.cs index 260364af2413..5dabba836b59 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomMultiLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ExportedCustomMultiLabelClassificationProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8J /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -57,19 +57,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomMultiLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedCustomMultiLabelClassificationProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomMultiLabelClassificationProjectAsset(document.RootElement, options); } - internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeExportedCustomMultiLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedCustomMultiLabelClassificationProjectAsset DeserializeExportedCustomMultiLabelClassificationProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeE } IList classes = default; IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,7 +114,7 @@ internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeE } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -123,46 +123,46 @@ internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeE } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomMultiLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + return new ExportedCustomMultiLabelClassificationProjectAsset(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedCustomMultiLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedCustomMultiLabelClassificationProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomMultiLabelClassificationProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomMultiLabelClassificationProjectAssets FromResponse(Response response) + internal static new ExportedCustomMultiLabelClassificationProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement); + return DeserializeExportedCustomMultiLabelClassificationProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.cs similarity index 75% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.cs index f7e762c59a43..63de6759bcf2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAsset.cs @@ -11,22 +11,22 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for a custom multi-label classification project. - public partial class ExportedCustomMultiLabelClassificationProjectAssets : ExportedProjectAssets + public partial class ExportedCustomMultiLabelClassificationProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomMultiLabelClassificationProjectAssets() + /// Initializes a new instance of . + public ExportedCustomMultiLabelClassificationProjectAsset() { - ProjectKind = ProjectKind.CustomMultiLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomMultiLabelClassification; Classes = new ChangeTrackingList(); Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of classes in the project. /// The list of documents in the project. - internal ExportedCustomMultiLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + internal ExportedCustomMultiLabelClassificationProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) { Classes = classes; Documents = documents; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.Serialization.cs similarity index 73% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.Serialization.cs index 48511313fd42..eb89597c63ca 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedCustomSingleLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + public partial class ExportedCustomSingleLabelClassificationProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8 /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -57,19 +57,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - ExportedCustomSingleLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExportedCustomSingleLabelClassificationProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomSingleLabelClassificationProjectAsset(document.RootElement, options); } - internal static ExportedCustomSingleLabelClassificationProjectAssets DeserializeExportedCustomSingleLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExportedCustomSingleLabelClassificationProjectAsset DeserializeExportedCustomSingleLabelClassificationProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static ExportedCustomSingleLabelClassificationProjectAssets Deserialize } IList classes = default; IList documents = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,7 +114,7 @@ internal static ExportedCustomSingleLabelClassificationProjectAssets Deserialize } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -123,46 +123,46 @@ internal static ExportedCustomSingleLabelClassificationProjectAssets Deserialize } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedCustomSingleLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + return new ExportedCustomSingleLabelClassificationProjectAsset(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedCustomSingleLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExportedCustomSingleLabelClassificationProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + return DeserializeExportedCustomSingleLabelClassificationProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new ExportedCustomSingleLabelClassificationProjectAssets FromResponse(Response response) + internal static new ExportedCustomSingleLabelClassificationProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement); + return DeserializeExportedCustomSingleLabelClassificationProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.cs similarity index 75% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.cs index ad0da5081ab2..c7cfe96339a3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAsset.cs @@ -11,22 +11,22 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the exported assets for a single-label classification project. - public partial class ExportedCustomSingleLabelClassificationProjectAssets : ExportedProjectAssets + public partial class ExportedCustomSingleLabelClassificationProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . - public ExportedCustomSingleLabelClassificationProjectAssets() + /// Initializes a new instance of . + public ExportedCustomSingleLabelClassificationProjectAsset() { - ProjectKind = ProjectKind.CustomSingleLabelClassification; + ProjectKind = TextAuthoringProjectKind.CustomSingleLabelClassification; Classes = new ChangeTrackingList(); Documents = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. /// The list of classes belonging to this project. /// The list of documents belonging to this project. - internal ExportedCustomSingleLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + internal ExportedCustomSingleLabelClassificationProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) { Classes = classes; Documents = documents; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs index f0f2a616ac1c..25fcf68c9568 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs @@ -86,7 +86,7 @@ internal static ExportedDocumentSentimentLabel DeserializeExportedDocumentSentim { return null; } - TextAnalysisAuthoringSentiment? category = default; + TextAuthoringSentiment? category = default; int? offset = default; int? length = default; IDictionary serializedAdditionalRawData = default; @@ -99,7 +99,7 @@ internal static ExportedDocumentSentimentLabel DeserializeExportedDocumentSentim { continue; } - category = new TextAnalysisAuthoringSentiment(property.Value.GetString()); + category = new TextAuthoringSentiment(property.Value.GetString()); continue; } if (property.NameEquals("offset"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs index dc1adbc74a16..4f553a11e722 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs @@ -55,7 +55,7 @@ public ExportedDocumentSentimentLabel() /// Start position for the sentiment text. /// Length for the sentiment text. /// Keeps track of any properties unknown to the library. - internal ExportedDocumentSentimentLabel(TextAnalysisAuthoringSentiment? category, int? offset, int? length, IDictionary serializedAdditionalRawData) + internal ExportedDocumentSentimentLabel(TextAuthoringSentiment? category, int? offset, int? length, IDictionary serializedAdditionalRawData) { Category = category; Offset = offset; @@ -64,7 +64,7 @@ internal ExportedDocumentSentimentLabel(TextAnalysisAuthoringSentiment? category } /// The sentiment category. - public TextAnalysisAuthoringSentiment? Category { get; set; } + public TextAuthoringSentiment? Category { get; set; } /// Start position for the sentiment text. public int? Offset { get; set; } /// Length for the sentiment text. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs deleted file mode 100644 index 0dbec264065a..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// Human-readable error code. - public readonly partial struct InnerErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InnerErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidRequestValue = "InvalidRequest"; - private const string InvalidParameterValueValue = "InvalidParameterValue"; - private const string KnowledgeBaseNotFoundValue = "KnowledgeBaseNotFound"; - private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; - private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; - private const string ExtractionFailureValue = "ExtractionFailure"; - private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat"; - private const string EmptyRequestValue = "EmptyRequest"; - private const string MissingInputDocumentsValue = "MissingInputDocuments"; - private const string InvalidDocumentValue = "InvalidDocument"; - private const string ModelVersionIncorrectValue = "ModelVersionIncorrect"; - private const string InvalidDocumentBatchValue = "InvalidDocumentBatch"; - private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode"; - private const string InvalidCountryHintValue = "InvalidCountryHint"; - - /// InvalidRequest. - public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue); - /// InvalidParameterValue. - public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue); - /// KnowledgeBaseNotFound. - public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue); - /// AzureCognitiveSearchNotFound. - public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue); - /// AzureCognitiveSearchThrottling. - public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue); - /// ExtractionFailure. - public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue); - /// InvalidRequestBodyFormat. - public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue); - /// EmptyRequest. - public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue); - /// MissingInputDocuments. - public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue); - /// InvalidDocument. - public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue); - /// ModelVersionIncorrect. - public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue); - /// InvalidDocumentBatch. - public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue); - /// UnsupportedLanguageCode. - public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue); - /// InvalidCountryHint. - public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue); - /// Determines if two values are the same. - public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InnerErrorCode left, InnerErrorCode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator InnerErrorCode(string value) => new InnerErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InnerErrorCode other && Equals(other); - /// - public bool Equals(InnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs deleted file mode 100644 index f461bad119e7..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class InnerErrorModel : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (Optional.IsCollectionDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteStartObject(); - foreach (var item in Details) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"u8); - writer.WriteStringValue(Target); - } - if (Optional.IsDefined(Innererror)) - { - writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(Innererror, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - InnerErrorModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInnerErrorModel(document.RootElement, options); - } - - internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InnerErrorCode code = default; - string message = default; - IReadOnlyDictionary details = default; - string target = default; - InnerErrorModel innererror = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = new InnerErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - details = dictionary; - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = DeserializeInnerErrorModel(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InnerErrorModel( - code, - message, - details ?? new ChangeTrackingDictionary(), - target, - innererror, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{options.Format}' format."); - } - } - - InnerErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInnerErrorModel(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static InnerErrorModel FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInnerErrorModel(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs deleted file mode 100644 index 8a526e0a0df3..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. - public partial class InnerErrorModel - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// is null. - internal InnerErrorModel(InnerErrorCode code, string message) - { - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// Error details. - /// Error target. - /// An object containing more specific information than the current object about the error. - /// Keeps track of any properties unknown to the library. - internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Details = details; - Target = target; - Innererror = innererror; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InnerErrorModel() - { - } - - /// One of a server-defined set of error codes. - public InnerErrorCode Code { get; } - /// Error message. - public string Message { get; } - /// Error details. - public IReadOnlyDictionary Details { get; } - /// Error target. - public string Target { get; } - /// An object containing more specific information than the current object about the error. - public InnerErrorModel Innererror { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs deleted file mode 100644 index 7bf195744b62..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The JobStatus. - public readonly partial struct JobStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JobStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NotStartedValue = "notStarted"; - private const string RunningValue = "running"; - private const string SucceededValue = "succeeded"; - private const string FailedValue = "failed"; - private const string CancelledValue = "cancelled"; - private const string CancellingValue = "cancelling"; - private const string PartiallyCompletedValue = "partiallyCompleted"; - - /// notStarted. - public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); - /// running. - public static JobStatus Running { get; } = new JobStatus(RunningValue); - /// succeeded. - public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); - /// failed. - public static JobStatus Failed { get; } = new JobStatus(FailedValue); - /// cancelled. - public static JobStatus Cancelled { get; } = new JobStatus(CancelledValue); - /// cancelling. - public static JobStatus Cancelling { get; } = new JobStatus(CancellingValue); - /// partiallyCompleted. - public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); - /// Determines if two values are the same. - public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator JobStatus(string value) => new JobStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JobStatus other && Equals(other); - /// - public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs deleted file mode 100644 index db31db0899db..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class ProjectDeletionJobState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{format}' format."); - } - - if (options.Format != "W") - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); - writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) - { - writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); - } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - if (Optional.IsCollectionDefined(Warnings)) - { - writer.WritePropertyName("warnings"u8); - writer.WriteStartArray(); - foreach (var item in Warnings) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Errors)) - { - writer.WritePropertyName("errors"u8); - writer.WriteStartArray(); - foreach (var item in Errors) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ProjectDeletionJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectDeletionJobState(document.RootElement, options); - } - - internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobId = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new JobStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("warnings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); - } - warnings = array; - continue; - } - if (property.NameEquals("errors"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); - } - errors = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProjectDeletionJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{options.Format}' format."); - } - } - - ProjectDeletionJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectDeletionJobState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ProjectDeletionJobState FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectDeletionJobState(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs index c917409f2951..10e3d189146d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs @@ -35,7 +35,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("confusionMatrix"u8); - writer.WriteObjectValue(ConfusionMatrix, options); + writer.WriteStartObject(); + foreach (var item in ConfusionMatrix) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); writer.WritePropertyName("classes"u8); writer.WriteStartObject(); foreach (var item in Classes) @@ -93,7 +99,7 @@ internal static SingleLabelClassificationEvaluationSummary DeserializeSingleLabe { return null; } - ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary confusionMatrix = default; IReadOnlyDictionary classes = default; float microF1 = default; float microPrecision = default; @@ -107,7 +113,12 @@ internal static SingleLabelClassificationEvaluationSummary DeserializeSingleLabe { if (property.NameEquals("confusionMatrix"u8)) { - confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, TextAuthoringConfusionMatrixRow.DeserializeTextAuthoringConfusionMatrixRow(property0.Value, options)); + } + confusionMatrix = dictionary; continue; } if (property.NameEquals("classes"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs index 3a735be43129..146996ee8ecb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs @@ -55,7 +55,7 @@ public partial class SingleLabelClassificationEvaluationSummary /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// or is null. - internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + internal SingleLabelClassificationEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) { Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); Argument.AssertNotNull(classes, nameof(classes)); @@ -80,7 +80,7 @@ internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMat /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + internal SingleLabelClassificationEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) { ConfusionMatrix = confusionMatrix; Classes = classes; @@ -99,7 +99,7 @@ internal SingleLabelClassificationEvaluationSummary() } /// Represents the confusion matrix between two classes (the two classes can be the same). The matrix is between the class that was labelled and the class that was predicted. - public ConfusionMatrix ConfusionMatrix { get; } + public IReadOnlyDictionary ConfusionMatrix { get; } /// Represents the classes evaluation. public IReadOnlyDictionary Classes { get; } /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs index 8d1f2520c7be..5cdd739b508c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs @@ -35,7 +35,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("confusionMatrix"u8); - writer.WriteObjectValue(ConfusionMatrix, options); + writer.WriteStartObject(); + foreach (var item in ConfusionMatrix) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); writer.WritePropertyName("sentiments"u8); writer.WriteStartObject(); foreach (var item in Sentiments) @@ -93,7 +99,7 @@ internal static SpanSentimentEvaluationSummary DeserializeSpanSentimentEvaluatio { return null; } - ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary confusionMatrix = default; IReadOnlyDictionary sentiments = default; float microF1 = default; float microPrecision = default; @@ -107,7 +113,12 @@ internal static SpanSentimentEvaluationSummary DeserializeSpanSentimentEvaluatio { if (property.NameEquals("confusionMatrix"u8)) { - confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, TextAuthoringConfusionMatrixRow.DeserializeTextAuthoringConfusionMatrixRow(property0.Value, options)); + } + confusionMatrix = dictionary; continue; } if (property.NameEquals("sentiments"u8)) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs index 7bb8d1d8d726..fcb3bc1f3f42 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs @@ -55,7 +55,7 @@ public partial class SpanSentimentEvaluationSummary /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// or is null. - internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + internal SpanSentimentEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) { Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); Argument.AssertNotNull(sentiments, nameof(sentiments)); @@ -80,7 +80,7 @@ internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOn /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// Keeps track of any properties unknown to the library. - internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + internal SpanSentimentEvaluationSummary(IReadOnlyDictionary confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) { ConfusionMatrix = confusionMatrix; Sentiments = sentiments; @@ -99,7 +99,7 @@ internal SpanSentimentEvaluationSummary() } /// Represents the confusion matrix between two sentiments (the two sentiments can be the same). The matrix is between the sentiment that was labelled and the sentiment that was predicted. - public ConfusionMatrix ConfusionMatrix { get; } + public IReadOnlyDictionary ConfusionMatrix { get; } /// Represents the sentiment evaluation. public IReadOnlyDictionary Sentiments { get; } /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs deleted file mode 100644 index 639bd57d140b..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class TextAnalysisAuthoringError : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"u8); - writer.WriteStringValue(Target); - } - if (Optional.IsCollectionDefined(Details)) - { - writer.WritePropertyName("details"u8); - writer.WriteStartArray(); - foreach (var item in Details) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Innererror)) - { - writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(Innererror, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TextAnalysisAuthoringError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTextAnalysisAuthoringError(document.RootElement, options); - } - - internal static TextAnalysisAuthoringError DeserializeTextAnalysisAuthoringError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ErrorCode code = default; - string message = default; - string target = default; - IReadOnlyList details = default; - InnerErrorModel innererror = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = new ErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target"u8)) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeTextAnalysisAuthoringError(item, options)); - } - details = array; - continue; - } - if (property.NameEquals("innererror"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TextAnalysisAuthoringError( - code, - message, - target, - details ?? new ChangeTrackingList(), - innererror, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support writing '{options.Format}' format."); - } - } - - TextAnalysisAuthoringError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTextAnalysisAuthoringError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static TextAnalysisAuthoringError FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeTextAnalysisAuthoringError(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs deleted file mode 100644 index 15dff55f6060..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The error object. - public partial class TextAnalysisAuthoringError - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// is null. - internal TextAnalysisAuthoringError(ErrorCode code, string message) - { - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - Details = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// An object containing more specific information than the current object about the error. - /// Keeps track of any properties unknown to the library. - internal TextAnalysisAuthoringError(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Target = target; - Details = details; - Innererror = innererror; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TextAnalysisAuthoringError() - { - } - - /// One of a server-defined set of error codes. - public ErrorCode Code { get; } - /// A human-readable representation of the error. - public string Message { get; } - /// The target of the error. - public string Target { get; } - /// An array of details about specific errors that led to this reported error. - public IReadOnlyList Details { get; } - /// An object containing more specific information than the current object about the error. - public InnerErrorModel Innererror { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs deleted file mode 100644 index 07d7c9165af7..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// The TextAnalysisAuthoringSentiment. - public readonly partial struct TextAnalysisAuthoringSentiment : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TextAnalysisAuthoringSentiment(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PositiveValue = "positive"; - private const string NegativeValue = "negative"; - private const string NeutralValue = "neutral"; - - /// positive. - public static TextAnalysisAuthoringSentiment Positive { get; } = new TextAnalysisAuthoringSentiment(PositiveValue); - /// negative. - public static TextAnalysisAuthoringSentiment Negative { get; } = new TextAnalysisAuthoringSentiment(NegativeValue); - /// neutral. - public static TextAnalysisAuthoringSentiment Neutral { get; } = new TextAnalysisAuthoringSentiment(NeutralValue); - /// Determines if two values are the same. - public static bool operator ==(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator TextAnalysisAuthoringSentiment(string value) => new TextAnalysisAuthoringSentiment(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TextAnalysisAuthoringSentiment other && Equals(other); - /// - public bool Equals(TextAnalysisAuthoringSentiment other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs deleted file mode 100644 index 80e627120fa3..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class TextAnalysisAuthoringWarning : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TextAnalysisAuthoringWarning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); - } - - internal static TextAnalysisAuthoringWarning DeserializeTextAnalysisAuthoringWarning(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TextAnalysisAuthoringWarning(code, message, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support writing '{options.Format}' format."); - } - } - - TextAnalysisAuthoringWarning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static TextAnalysisAuthoringWarning FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeTextAnalysisAuthoringWarning(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs deleted file mode 100644 index cfea09f1cf4d..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - /// Represents a warning that was encountered while executing the request. - public partial class TextAnalysisAuthoringWarning - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// or is null. - internal TextAnalysisAuthoringWarning(string code, string message) - { - Argument.AssertNotNull(code, nameof(code)); - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - } - - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// Keeps track of any properties unknown to the library. - internal TextAnalysisAuthoringWarning(string code, string message, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal TextAnalysisAuthoringWarning() - { - } - - /// The warning code. - public string Code { get; } - /// The warning message. - public string Message { get; } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.Serialization.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.Serialization.cs index 70b3163cb78c..a0b91e18355d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class AssignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringAssignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("resourcesMetadata"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringAssignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + return DeserializeTextAuthoringAssignDeploymentResourcesDetails(document.RootElement, options); } - internal static AssignDeploymentResourcesDetails DeserializeAssignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringAssignDeploymentResourcesDetails DeserializeTextAuthoringAssignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -78,17 +78,17 @@ internal static AssignDeploymentResourcesDetails DeserializeAssignDeploymentReso { return null; } - IList resourcesMetadata = default; + IList resourcesMetadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resourcesMetadata"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ResourceMetadata.DeserializeResourceMetadata(item, options)); + array.Add(TextAuthoringResourceMetadata.DeserializeTextAuthoringResourceMetadata(item, options)); } resourcesMetadata = array; continue; @@ -99,46 +99,46 @@ internal static AssignDeploymentResourcesDetails DeserializeAssignDeploymentReso } } serializedAdditionalRawData = rawDataDictionary; - return new AssignDeploymentResourcesDetails(resourcesMetadata, serializedAdditionalRawData); + return new TextAuthoringAssignDeploymentResourcesDetails(resourcesMetadata, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); } } - AssignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringAssignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + return DeserializeTextAuthoringAssignDeploymentResourcesDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AssignDeploymentResourcesDetails FromResponse(Response response) + internal static TextAuthoringAssignDeploymentResourcesDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignDeploymentResourcesDetails(document.RootElement); + return DeserializeTextAuthoringAssignDeploymentResourcesDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.cs similarity index 74% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.cs index 2bbfb5188cb7..5bf9deb0b1ff 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesDetails.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for assigning Azure resources to a project. - public partial class AssignDeploymentResourcesDetails + public partial class TextAuthoringAssignDeploymentResourcesDetails { /// /// Keeps track of any properties unknown to the library. @@ -46,31 +46,31 @@ public partial class AssignDeploymentResourcesDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the metadata for the resources to be assigned. /// is null. - public AssignDeploymentResourcesDetails(IEnumerable resourcesMetadata) + public TextAuthoringAssignDeploymentResourcesDetails(IEnumerable resourcesMetadata) { Argument.AssertNotNull(resourcesMetadata, nameof(resourcesMetadata)); ResourcesMetadata = resourcesMetadata.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the metadata for the resources to be assigned. /// Keeps track of any properties unknown to the library. - internal AssignDeploymentResourcesDetails(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + internal TextAuthoringAssignDeploymentResourcesDetails(IList resourcesMetadata, IDictionary serializedAdditionalRawData) { ResourcesMetadata = resourcesMetadata; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssignDeploymentResourcesDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringAssignDeploymentResourcesDetails() { } /// Represents the metadata for the resources to be assigned. - public IList ResourcesMetadata { get; } + public IList ResourcesMetadata { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.Serialization.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.Serialization.cs index feb11863a23d..58968090d0e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class LoadSnapshotJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringAssignDeploymentResourcesOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - LoadSnapshotJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringAssignDeploymentResourcesOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLoadSnapshotJobState(document.RootElement, options); + return DeserializeTextAuthoringAssignDeploymentResourcesOperationState(document.RootElement, options); } - internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringAssignDeploymentResourcesOperationState DeserializeTextAuthoringAssignDeploymentResourcesOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new LoadSnapshotJobState( + return new TextAuthoringAssignDeploymentResourcesOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesOperationState)} does not support writing '{options.Format}' format."); } } - LoadSnapshotJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringAssignDeploymentResourcesOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLoadSnapshotJobState(document.RootElement, options); + return DeserializeTextAuthoringAssignDeploymentResourcesOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignDeploymentResourcesOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static LoadSnapshotJobState FromResponse(Response response) + internal static TextAuthoringAssignDeploymentResourcesOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeLoadSnapshotJobState(document.RootElement); + return DeserializeTextAuthoringAssignDeploymentResourcesOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.cs similarity index 57% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.cs index 7661a3cd0353..aa458fc52bfb 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignDeploymentResourcesOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a assign deployment resources job. - public partial class AssignDeploymentResourcesJobState + public partial class TextAuthoringAssignDeploymentResourcesOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class AssignDeploymentResourcesJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal AssignDeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringAssignDeploymentResourcesOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal AssignDeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringAssignDeploymentResourcesOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssignDeploymentResourcesJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringAssignDeploymentResourcesOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.Serialization.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.Serialization.cs index 9bfeba044263..b9a1371e41c7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class AssignedDeploymentResource : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringAssignedDeploymentResource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedDeploymentResource)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssignedDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringAssignedDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedDeploymentResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignedDeploymentResource(document.RootElement, options); + return DeserializeTextAuthoringAssignedDeploymentResource(document.RootElement, options); } - internal static AssignedDeploymentResource DeserializeAssignedDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringAssignedDeploymentResource DeserializeTextAuthoringAssignedDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static AssignedDeploymentResource DeserializeAssignedDeploymentResource } } serializedAdditionalRawData = rawDataDictionary; - return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData); + return new TextAuthoringAssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedDeploymentResource)} does not support writing '{options.Format}' format."); } } - AssignedDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringAssignedDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignedDeploymentResource(document.RootElement, options); + return DeserializeTextAuthoringAssignedDeploymentResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedDeploymentResource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AssignedDeploymentResource FromResponse(Response response) + internal static TextAuthoringAssignedDeploymentResource FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignedDeploymentResource(document.RootElement); + return DeserializeTextAuthoringAssignedDeploymentResource(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.cs similarity index 78% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.cs index 3981d1d5e0f4..9f22d3172d48 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedDeploymentResource.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the assigned deployment resource. - public partial class AssignedDeploymentResource + public partial class TextAuthoringAssignedDeploymentResource { /// /// Keeps track of any properties unknown to the library. @@ -45,29 +45,29 @@ public partial class AssignedDeploymentResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The resource region. /// is null. - internal AssignedDeploymentResource(string region) + internal TextAuthoringAssignedDeploymentResource(string region) { Argument.AssertNotNull(region, nameof(region)); Region = region; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The resource ID. /// The resource region. /// Keeps track of any properties unknown to the library. - internal AssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) + internal TextAuthoringAssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) { AzureResourceId = azureResourceId; Region = region; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssignedDeploymentResource() + /// Initializes a new instance of for deserialization. + internal TextAuthoringAssignedDeploymentResource() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.Serialization.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.Serialization.cs index d30582549888..0bebc92be092 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class AssignedProjectDeploymentMetadata : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringAssignedProjectDeploymentMetadata : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,18 +28,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentMetadata)} does not support writing '{format}' format."); } writer.WritePropertyName("deploymentName"u8); writer.WriteStringValue(DeploymentName); writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WriteStringValue(LastDeployedOn, "O"); writer.WritePropertyName("deploymentExpirationDate"u8); - writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WriteStringValue(DeploymentExpiresOn, "D"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssignedProjectDeploymentMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringAssignedProjectDeploymentMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentMetadata)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + return DeserializeTextAuthoringAssignedProjectDeploymentMetadata(document.RootElement, options); } - internal static AssignedProjectDeploymentMetadata DeserializeAssignedProjectDeploymentMetadata(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringAssignedProjectDeploymentMetadata DeserializeTextAuthoringAssignedProjectDeploymentMetadata(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -105,46 +105,46 @@ internal static AssignedProjectDeploymentMetadata DeserializeAssignedProjectDepl } } serializedAdditionalRawData = rawDataDictionary; - return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData); + return new TextAuthoringAssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentMetadata)} does not support writing '{options.Format}' format."); } } - AssignedProjectDeploymentMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringAssignedProjectDeploymentMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + return DeserializeTextAuthoringAssignedProjectDeploymentMetadata(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentMetadata)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AssignedProjectDeploymentMetadata FromResponse(Response response) + internal static TextAuthoringAssignedProjectDeploymentMetadata FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignedProjectDeploymentMetadata(document.RootElement); + return DeserializeTextAuthoringAssignedProjectDeploymentMetadata(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.cs index 8b5d9c8fe883..d55e714b9e7f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentMetadata.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the metadata for an assigned deployment. - public partial class AssignedProjectDeploymentMetadata + public partial class TextAuthoringAssignedProjectDeploymentMetadata { /// /// Keeps track of any properties unknown to the library. @@ -45,43 +45,43 @@ public partial class AssignedProjectDeploymentMetadata /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// is null. - internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate) + internal TextAuthoringAssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiresOn) { Argument.AssertNotNull(deploymentName, nameof(deploymentName)); DeploymentName = deploymentName; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastDeployedOn = lastDeployedOn; + DeploymentExpiresOn = deploymentExpiresOn; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Keeps track of any properties unknown to the library. - internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, IDictionary serializedAdditionalRawData) + internal TextAuthoringAssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiresOn, IDictionary serializedAdditionalRawData) { DeploymentName = deploymentName; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastDeployedOn = lastDeployedOn; + DeploymentExpiresOn = deploymentExpiresOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssignedProjectDeploymentMetadata() + /// Initializes a new instance of for deserialization. + internal TextAuthoringAssignedProjectDeploymentMetadata() { } /// Represents the deployment name. public string DeploymentName { get; } /// Represents deployment last deployed time. - public DateTimeOffset LastDeployedDateTime { get; } + public DateTimeOffset LastDeployedOn { get; } /// Represents deployment expiration date in the runtime. - public DateTimeOffset DeploymentExpirationDate { get; } + public DateTimeOffset DeploymentExpiresOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.Serialization.cs similarity index 60% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.Serialization.cs index fa117bf2c3ec..62d78c5d12d1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class AssignedProjectDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringAssignedProjectDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AssignedProjectDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringAssignedProjectDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentsMetadata)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + return DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(document.RootElement, options); } - internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringAssignedProjectDeploymentsMetadata DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,7 +84,7 @@ internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDep return null; } string projectName = default; - IReadOnlyList deploymentsMetadata = default; + IReadOnlyList deploymentsMetadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,10 +96,10 @@ internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDep } if (property.NameEquals("deploymentsMetadata"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AssignedProjectDeploymentMetadata.DeserializeAssignedProjectDeploymentMetadata(item, options)); + array.Add(TextAuthoringAssignedProjectDeploymentMetadata.DeserializeTextAuthoringAssignedProjectDeploymentMetadata(item, options)); } deploymentsMetadata = array; continue; @@ -110,46 +110,46 @@ internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDep } } serializedAdditionalRawData = rawDataDictionary; - return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata, serializedAdditionalRawData); + return new TextAuthoringAssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentsMetadata)} does not support writing '{options.Format}' format."); } } - AssignedProjectDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringAssignedProjectDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + return DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringAssignedProjectDeploymentsMetadata)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AssignedProjectDeploymentsMetadata FromResponse(Response response) + internal static TextAuthoringAssignedProjectDeploymentsMetadata FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement); + return DeserializeTextAuthoringAssignedProjectDeploymentsMetadata(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.cs similarity index 73% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.cs index f7ddb77f5cdb..e83644c2bc92 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringAssignedProjectDeploymentsMetadata.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the metadata for assigned deployments for a project. - public partial class AssignedProjectDeploymentsMetadata + public partial class TextAuthoringAssignedProjectDeploymentsMetadata { /// /// Keeps track of any properties unknown to the library. @@ -46,35 +46,35 @@ public partial class AssignedProjectDeploymentsMetadata /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the resource region. /// is null. - internal AssignedProjectDeploymentsMetadata(IEnumerable deploymentsMetadata) + internal TextAuthoringAssignedProjectDeploymentsMetadata(IEnumerable deploymentsMetadata) { Argument.AssertNotNull(deploymentsMetadata, nameof(deploymentsMetadata)); DeploymentsMetadata = deploymentsMetadata.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project name. /// Represents the resource region. /// Keeps track of any properties unknown to the library. - internal AssignedProjectDeploymentsMetadata(string projectName, IReadOnlyList deploymentsMetadata, IDictionary serializedAdditionalRawData) + internal TextAuthoringAssignedProjectDeploymentsMetadata(string projectName, IReadOnlyList deploymentsMetadata, IDictionary serializedAdditionalRawData) { ProjectName = projectName; DeploymentsMetadata = deploymentsMetadata; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AssignedProjectDeploymentsMetadata() + /// Initializes a new instance of for deserialization. + internal TextAuthoringAssignedProjectDeploymentsMetadata() { } /// Represents the project name. public string ProjectName { get; } /// Represents the resource region. - public IReadOnlyList DeploymentsMetadata { get; } + public IReadOnlyList DeploymentsMetadata { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCompositionMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCompositionMode.cs new file mode 100644 index 000000000000..ff96482a5758 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCompositionMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The TextAuthoringCompositionMode. + public readonly partial struct TextAuthoringCompositionMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAuthoringCompositionMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// Every component's match or prediction is returned as a separate instance of the entity. + public static TextAuthoringCompositionMode SeparateComponents { get; } = new TextAuthoringCompositionMode(SeparateComponentsValue); + /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. + public static TextAuthoringCompositionMode CombineComponents { get; } = new TextAuthoringCompositionMode(CombineComponentsValue); + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringCompositionMode left, TextAuthoringCompositionMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringCompositionMode left, TextAuthoringCompositionMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAuthoringCompositionMode(string value) => new TextAuthoringCompositionMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAuthoringCompositionMode other && Equals(other); + /// + public bool Equals(TextAuthoringCompositionMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.Serialization.cs index 8b4459453a7b..5ddc9f435ed8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixCell)} does not support writing '{format}' format."); } writer.WritePropertyName("normalizedValue"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixCell)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrixCell(document.RootElement, options); + return DeserializeTextAuthoringConfusionMatrixCell(document.RootElement, options); } - internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringConfusionMatrixCell DeserializeTextAuthoringConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); + return new TextAuthoringConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixCell)} does not support writing '{options.Format}' format."); } } - ConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrixCell(document.RootElement, options); + return DeserializeTextAuthoringConfusionMatrixCell(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixCell)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ConfusionMatrixCell FromResponse(Response response) + internal static TextAuthoringConfusionMatrixCell FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrixCell(document.RootElement); + return DeserializeTextAuthoringConfusionMatrixCell(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.cs similarity index 79% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.cs index b75dec32f7eb..8da2fd645009 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixCell.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a cell in a confusion matrix. - public partial class ConfusionMatrixCell + public partial class TextAuthoringConfusionMatrixCell { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,28 @@ public partial class ConfusionMatrixCell /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. - internal ConfusionMatrixCell(float normalizedValue, float rawValue) + internal TextAuthoringConfusionMatrixCell(float normalizedValue, float rawValue) { NormalizedValue = normalizedValue; RawValue = rawValue; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. /// Keeps track of any properties unknown to the library. - internal ConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) + internal TextAuthoringConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) { NormalizedValue = normalizedValue; RawValue = rawValue; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ConfusionMatrixCell() + /// Initializes a new instance of for deserialization. + internal TextAuthoringConfusionMatrixCell() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.Serialization.cs similarity index 60% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.Serialization.cs index eb422157be56..dfbcc65edf1a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixRow)} does not support writing '{format}' format."); } foreach (var item in AdditionalProperties) @@ -48,19 +48,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixRow)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeConfusionMatrixRow(document.RootElement, options); + return DeserializeTextAuthoringConfusionMatrixRow(document.RootElement, options); } - internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringConfusionMatrixRow DeserializeTextAuthoringConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -75,46 +75,46 @@ internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement ele additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new ConfusionMatrixRow(additionalProperties); + return new TextAuthoringConfusionMatrixRow(additionalProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixRow)} does not support writing '{options.Format}' format."); } } - ConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeConfusionMatrixRow(document.RootElement, options); + return DeserializeTextAuthoringConfusionMatrixRow(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringConfusionMatrixRow)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ConfusionMatrixRow FromResponse(Response response) + internal static TextAuthoringConfusionMatrixRow FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeConfusionMatrixRow(document.RootElement); + return DeserializeTextAuthoringConfusionMatrixRow(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.cs similarity index 77% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.cs index 004bbed08c3c..51c9ae121667 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringConfusionMatrixRow.cs @@ -10,18 +10,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// The ConfusionMatrix. - public partial class ConfusionMatrix + /// The TextAuthoringConfusionMatrixRow. + public partial class TextAuthoringConfusionMatrixRow { - /// Initializes a new instance of . - internal ConfusionMatrix() + /// Initializes a new instance of . + internal TextAuthoringConfusionMatrixRow() { AdditionalProperties = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Additional Properties. - internal ConfusionMatrix(IReadOnlyDictionary additionalProperties) + internal TextAuthoringConfusionMatrixRow(IReadOnlyDictionary additionalProperties) { AdditionalProperties = additionalProperties; } @@ -39,7 +39,7 @@ internal ConfusionMatrix(IReadOnlyDictionary additionalPrope /// Supported types: /// /// - /// + /// /// /// /// diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.Serialization.cs index 699a616472f5..416768f65637 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class CopyProjectDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringCopyProjectDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CopyProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringCopyProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCopyProjectDetails(document.RootElement, options); + return DeserializeTextAuthoringCopyProjectDetails(document.RootElement, options); } - internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringCopyProjectDetails DeserializeTextAuthoringCopyProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele { return null; } - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string targetProjectName = default; string accessToken = default; DateTimeOffset expiresAt = default; @@ -95,7 +95,7 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("targetProjectName"u8)) @@ -129,7 +129,7 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new CopyProjectDetails( + return new TextAuthoringCopyProjectDetails( projectKind, targetProjectName, accessToken, @@ -139,43 +139,43 @@ internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement ele serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectDetails)} does not support writing '{options.Format}' format."); } } - CopyProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringCopyProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCopyProjectDetails(document.RootElement, options); + return DeserializeTextAuthoringCopyProjectDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CopyProjectDetails FromResponse(Response response) + internal static TextAuthoringCopyProjectDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCopyProjectDetails(document.RootElement); + return DeserializeTextAuthoringCopyProjectDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.cs similarity index 82% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.cs index 899d7879a650..087e0e67f5a9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for copying an existing project to another Azure resource. - public partial class CopyProjectDetails + public partial class TextAuthoringCopyProjectDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,7 +45,7 @@ public partial class CopyProjectDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project kind. /// The project name to be copied-into. /// The access token. @@ -53,7 +53,7 @@ public partial class CopyProjectDetails /// Represents the target Azure resource ID. /// Represents the target Azure resource region. /// , , or is null. - public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) + public TextAuthoringCopyProjectDetails(TextAuthoringProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { Argument.AssertNotNull(targetProjectName, nameof(targetProjectName)); Argument.AssertNotNull(accessToken, nameof(accessToken)); @@ -68,7 +68,7 @@ public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, str TargetResourceRegion = targetResourceRegion; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project kind. /// The project name to be copied-into. /// The access token. @@ -76,7 +76,7 @@ public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, str /// Represents the target Azure resource ID. /// Represents the target Azure resource region. /// Keeps track of any properties unknown to the library. - internal CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) + internal TextAuthoringCopyProjectDetails(TextAuthoringProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; TargetProjectName = targetProjectName; @@ -87,13 +87,13 @@ internal CopyProjectDetails(ProjectKind projectKind, string targetProjectName, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CopyProjectDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringCopyProjectDetails() { } /// Represents the project kind. - public ProjectKind ProjectKind { get; set; } + public TextAuthoringProjectKind ProjectKind { get; set; } /// The project name to be copied-into. public string TargetProjectName { get; set; } /// The access token. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.Serialization.cs index 75db8690ed14..ba5848a8509f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ImportProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringCopyProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ImportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringCopyProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeImportProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringCopyProjectOperationState(document.RootElement, options); } - internal static ImportProjectJobState DeserializeImportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringCopyProjectOperationState DeserializeTextAuthoringCopyProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static ImportProjectJobState DeserializeImportProjectJobState(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ImportProjectJobState( + return new TextAuthoringCopyProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectOperationState)} does not support writing '{options.Format}' format."); } } - ImportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringCopyProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeImportProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringCopyProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCopyProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ImportProjectJobState FromResponse(Response response) + internal static TextAuthoringCopyProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeImportProjectJobState(document.RootElement); + return DeserializeTextAuthoringCopyProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.cs index 7c7212e10068..23e6fad87bdd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCopyProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a copy job. - public partial class CopyProjectJobState + public partial class TextAuthoringCopyProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class CopyProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal CopyProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringCopyProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal CopyProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringCopyProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CopyProjectJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringCopyProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.Serialization.cs index a432f8ae24e3..8c06150042b2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class CreateDeploymentDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringCreateDeploymentDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateDeploymentDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("trainedModelLabel"u8); @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CreateDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringCreateDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateDeploymentDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCreateDeploymentDetails(document.RootElement, options); + return DeserializeTextAuthoringCreateDeploymentDetails(document.RootElement, options); } - internal static CreateDeploymentDetails DeserializeCreateDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringCreateDeploymentDetails DeserializeTextAuthoringCreateDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -114,46 +114,46 @@ internal static CreateDeploymentDetails DeserializeCreateDeploymentDetails(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateDeploymentDetails)} does not support writing '{options.Format}' format."); } } - CreateDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringCreateDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCreateDeploymentDetails(document.RootElement, options); + return DeserializeTextAuthoringCreateDeploymentDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateDeploymentDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CreateDeploymentDetails FromResponse(Response response) + internal static TextAuthoringCreateDeploymentDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCreateDeploymentDetails(document.RootElement); + return DeserializeTextAuthoringCreateDeploymentDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.cs similarity index 81% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.cs index 31478d43ba9a..d2e28dbbc3ec 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateDeploymentDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for creating or updating a project deployment. - public partial class CreateDeploymentDetails + public partial class TextAuthoringCreateDeploymentDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,10 +45,10 @@ public partial class CreateDeploymentDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the trained model label. /// is null. - public CreateDeploymentDetails(string trainedModelLabel) + public TextAuthoringCreateDeploymentDetails(string trainedModelLabel) { Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); @@ -56,19 +56,19 @@ public CreateDeploymentDetails(string trainedModelLabel) AssignedResourceIds = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the trained model label. /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. /// Keeps track of any properties unknown to the library. - internal CreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + internal TextAuthoringCreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) { TrainedModelLabel = trainedModelLabel; AssignedResourceIds = assignedResourceIds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CreateDeploymentDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringCreateDeploymentDetails() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.Serialization.cs similarity index 71% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.Serialization.cs index 06633dd50ab3..9cd745f579fd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class CreateProjectDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringCreateProjectDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateProjectDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -74,19 +74,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CreateProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringCreateProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateProjectDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCreateProjectDetails(document.RootElement, options); + return DeserializeTextAuthoringCreateProjectDetails(document.RootElement, options); } - internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringCreateProjectDetails DeserializeTextAuthoringCreateProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,9 +94,9 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { return null; } - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string storageInputContainerName = default; - ProjectSettings settings = default; + TextAuthoringProjectSettings settings = default; string projectName = default; bool? multilingual = default; string description = default; @@ -107,7 +107,7 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("storageInputContainerName"u8)) @@ -121,7 +121,7 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement { continue; } - settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + settings = TextAuthoringProjectSettings.DeserializeTextAuthoringProjectSettings(property.Value, options); continue; } if (property.NameEquals("projectName"u8)) @@ -154,7 +154,7 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new CreateProjectDetails( + return new TextAuthoringCreateProjectDetails( projectKind, storageInputContainerName, settings, @@ -165,43 +165,43 @@ internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateProjectDetails)} does not support writing '{options.Format}' format."); } } - CreateProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringCreateProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCreateProjectDetails(document.RootElement, options); + return DeserializeTextAuthoringCreateProjectDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringCreateProjectDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CreateProjectDetails FromResponse(Response response) + internal static TextAuthoringCreateProjectDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCreateProjectDetails(document.RootElement); + return DeserializeTextAuthoringCreateProjectDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.cs similarity index 81% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.cs index 4a9996f0b77c..ec34c4211418 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringCreateProjectDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options used to create or update a project. - public partial class CreateProjectDetails + public partial class TextAuthoringCreateProjectDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class CreateProjectDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The project kind. /// The storage container name. /// The new project name. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// , or is null. - public CreateProjectDetails(ProjectKind projectKind, string storageInputContainerName, string projectName, string language) + public TextAuthoringCreateProjectDetails(TextAuthoringProjectKind projectKind, string storageInputContainerName, string projectName, string language) { Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); Argument.AssertNotNull(projectName, nameof(projectName)); @@ -63,7 +63,7 @@ public CreateProjectDetails(ProjectKind projectKind, string storageInputContaine Language = language; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The project kind. /// The storage container name. /// The project settings. @@ -72,7 +72,7 @@ public CreateProjectDetails(ProjectKind projectKind, string storageInputContaine /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal CreateProjectDetails(ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal TextAuthoringCreateProjectDetails(TextAuthoringProjectKind projectKind, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; StorageInputContainerName = storageInputContainerName; @@ -84,17 +84,17 @@ internal CreateProjectDetails(ProjectKind projectKind, string storageInputContai _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CreateProjectDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringCreateProjectDetails() { } /// The project kind. - public ProjectKind ProjectKind { get; } + public TextAuthoringProjectKind ProjectKind { get; } /// The storage container name. public string StorageInputContainerName { get; } /// The project settings. - public ProjectSettings Settings { get; set; } + public TextAuthoringProjectSettings Settings { get; set; } /// The new project name. public string ProjectName { get; } /// Whether the project would be used for multiple languages or not. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.Serialization.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.Serialization.cs index 77445449cbf0..f865ff7ea95d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DeleteDeploymentDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringDeleteDeploymentDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeleteDeploymentDetails)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(AssignedResourceIds)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeleteDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDeleteDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeleteDeploymentDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeleteDeploymentDetails(document.RootElement, options); + return DeserializeTextAuthoringDeleteDeploymentDetails(document.RootElement, options); } - internal static DeleteDeploymentDetails DeserializeDeleteDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringDeleteDeploymentDetails DeserializeTextAuthoringDeleteDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -106,46 +106,46 @@ internal static DeleteDeploymentDetails DeserializeDeleteDeploymentDetails(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new DeleteDeploymentDetails(assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringDeleteDeploymentDetails(assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeleteDeploymentDetails)} does not support writing '{options.Format}' format."); } } - DeleteDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDeleteDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeleteDeploymentDetails(document.RootElement, options); + return DeserializeTextAuthoringDeleteDeploymentDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeleteDeploymentDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeleteDeploymentDetails FromResponse(Response response) + internal static TextAuthoringDeleteDeploymentDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeleteDeploymentDetails(document.RootElement); + return DeserializeTextAuthoringDeleteDeploymentDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.cs similarity index 84% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.cs index 013bd28896db..329c0ed13c25 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeleteDeploymentDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for deleting a project deployment. - public partial class DeleteDeploymentDetails + public partial class TextAuthoringDeleteDeploymentDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class DeleteDeploymentDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeleteDeploymentDetails() + /// Initializes a new instance of . + public TextAuthoringDeleteDeploymentDetails() { AssignedResourceIds = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the resource IDs to delete the deployment from. If not provided, the deployment will be rolled out from all the resources it is deployed to. If provided, it will delete the deployment only from the specified assigned resources, and leave it for the rest. /// Keeps track of any properties unknown to the library. - internal DeleteDeploymentDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeleteDeploymentDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) { AssignedResourceIds = assignedResourceIds; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.Serialization.cs new file mode 100644 index 000000000000..cc9e7500b57a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TextAuthoringDeploymentDeleteFromResourcesOperationState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAuthoringDeploymentDeleteFromResourcesOperationState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedOn, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextAuthoringDeploymentDeleteFromResourcesOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAuthoringDeploymentDeleteFromResourcesOperationState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAuthoringDeploymentDeleteFromResourcesOperationState(document.RootElement, options); + } + + internal static TextAuthoringDeploymentDeleteFromResourcesOperationState DeserializeTextAuthoringDeploymentDeleteFromResourcesOperationState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new TextAuthoringOperationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextAuthoringDeploymentDeleteFromResourcesOperationState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextAuthoringDeploymentDeleteFromResourcesOperationState)} does not support writing '{options.Format}' format."); + } + } + + TextAuthoringDeploymentDeleteFromResourcesOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextAuthoringDeploymentDeleteFromResourcesOperationState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAuthoringDeploymentDeleteFromResourcesOperationState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextAuthoringDeploymentDeleteFromResourcesOperationState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAuthoringDeploymentDeleteFromResourcesOperationState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.cs similarity index 57% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.cs index 6a8b7545d2f6..4f558b57be15 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentDeleteFromResourcesOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of an existing delete deployment from specific resources job. - public partial class DeploymentDeleteFromResourcesJobState + public partial class TextAuthoringDeploymentDeleteFromResourcesOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class DeploymentDeleteFromResourcesJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal DeploymentDeleteFromResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringDeploymentDeleteFromResourcesOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal DeploymentDeleteFromResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentDeleteFromResourcesOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentDeleteFromResourcesJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringDeploymentDeleteFromResourcesOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.Serialization.cs similarity index 71% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.Serialization.cs index e10e17952121..7488c87edec2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DeploymentDeleteFromResourcesJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringDeploymentOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentDeleteFromResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDeploymentOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringDeploymentOperationState(document.RootElement, options); } - internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDeleteFromResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringDeploymentOperationState DeserializeTextAuthoringDeploymentOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentDeleteFromResourcesJobState( + return new TextAuthoringDeploymentOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentOperationState)} does not support writing '{options.Format}' format."); } } - DeploymentDeleteFromResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDeploymentOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringDeploymentOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentDeleteFromResourcesJobState FromResponse(Response response) + internal static TextAuthoringDeploymentOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement); + return DeserializeTextAuthoringDeploymentOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.cs index f888f341cfa1..8ca06cbc4812 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a deployment job. - public partial class DeploymentJobState + public partial class TextAuthoringDeploymentOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class DeploymentJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal DeploymentJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringDeploymentOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal DeploymentJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringDeploymentOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.Serialization.cs index 326ec2ad2885..be014c7a438a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DeploymentResource : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringDeploymentResource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResource)} does not support writing '{format}' format."); } writer.WritePropertyName("resourceId"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentResource(document.RootElement, options); + return DeserializeTextAuthoringDeploymentResource(document.RootElement, options); } - internal static DeploymentResource DeserializeDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringDeploymentResource DeserializeTextAuthoringDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static DeploymentResource DeserializeDeploymentResource(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentResource(resourceId, region, serializedAdditionalRawData); + return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResource)} does not support writing '{options.Format}' format."); } } - DeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentResource(document.RootElement, options); + return DeserializeTextAuthoringDeploymentResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDeploymentResource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentResource FromResponse(Response response) + internal static TextAuthoringDeploymentResource FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentResource(document.RootElement); + return DeserializeTextAuthoringDeploymentResource(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.cs similarity index 80% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.cs index 1f71c697bb26..14c441a3632b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDeploymentResource.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents an Azure resource assigned to a deployment. - public partial class DeploymentResource + public partial class TextAuthoringDeploymentResource { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class DeploymentResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the Azure resource Id. /// Represents the resource region. /// or is null. - internal DeploymentResource(string resourceId, string region) + internal TextAuthoringDeploymentResource(string resourceId, string region) { Argument.AssertNotNull(resourceId, nameof(resourceId)); Argument.AssertNotNull(region, nameof(region)); @@ -58,19 +58,19 @@ internal DeploymentResource(string resourceId, string region) Region = region; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the Azure resource Id. /// Represents the resource region. /// Keeps track of any properties unknown to the library. - internal DeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) + internal TextAuthoringDeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) { ResourceId = resourceId; Region = region; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentResource() + /// Initializes a new instance of for deserialization. + internal TextAuthoringDeploymentResource() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.Serialization.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.Serialization.cs index be013318e43f..4bd8c0dbfb63 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.Language.Text.Authoring.Models { - [PersistableModelProxy(typeof(UnknownDocumentEvaluationResult))] - public partial class DocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownTextAuthoringDocumentEvaluationResult))] + public partial class TextAuthoringDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDocumentEvaluationResult(document.RootElement, options); + return DeserializeTextAuthoringDocumentEvaluationResult(document.RootElement, options); } - internal static DocumentEvaluationResult DeserializeDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringDocumentEvaluationResult DeserializeTextAuthoringDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,46 +88,46 @@ internal static DocumentEvaluationResult DeserializeDocumentEvaluationResult(Jso case "CustomTextSentiment": return CustomTextSentimentDocumentEvaluationResult.DeserializeCustomTextSentimentDocumentEvaluationResult(element, options); } } - return UnknownDocumentEvaluationResult.DeserializeUnknownDocumentEvaluationResult(element, options); + return UnknownTextAuthoringDocumentEvaluationResult.DeserializeUnknownTextAuthoringDocumentEvaluationResult(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support writing '{options.Format}' format."); } } - DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDocumentEvaluationResult(document.RootElement, options); + return DeserializeTextAuthoringDocumentEvaluationResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DocumentEvaluationResult FromResponse(Response response) + internal static TextAuthoringDocumentEvaluationResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDocumentEvaluationResult(document.RootElement); + return DeserializeTextAuthoringDocumentEvaluationResult(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.cs similarity index 77% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.cs index 1eb6a64b3511..40c69d37891b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringDocumentEvaluationResult.cs @@ -12,10 +12,10 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// /// Represents the evaluation result of a document. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// - public abstract partial class DocumentEvaluationResult + public abstract partial class TextAuthoringDocumentEvaluationResult { /// /// Keeps track of any properties unknown to the library. @@ -49,11 +49,11 @@ public abstract partial class DocumentEvaluationResult /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the document path. /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// or is null. - protected DocumentEvaluationResult(string location, string language) + protected TextAuthoringDocumentEvaluationResult(string location, string language) { Argument.AssertNotNull(location, nameof(location)); Argument.AssertNotNull(language, nameof(language)); @@ -62,12 +62,12 @@ protected DocumentEvaluationResult(string location, string language) Language = language; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project kind. /// Represents the document path. /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal DocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) + internal TextAuthoringDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; Location = location; @@ -75,13 +75,13 @@ internal DocumentEvaluationResult(ProjectKind projectKind, string location, stri _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DocumentEvaluationResult() + /// Initializes a new instance of for deserialization. + internal TextAuthoringDocumentEvaluationResult() { } /// Represents the project kind. - internal ProjectKind ProjectKind { get; set; } + internal TextAuthoringProjectKind ProjectKind { get; set; } /// Represents the document path. public string Location { get; } /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.Serialization.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.Serialization.cs index 5826c81af6f9..c70c06f13b08 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class EntityEvaluationSummary : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringEntityEvaluationSummary : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEntityEvaluationSummary)} does not support writing '{format}' format."); } writer.WritePropertyName("f1"u8); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EntityEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEntityEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEntityEvaluationSummary)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEntityEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEntityEvaluationSummary(document.RootElement, options); } - internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringEntityEvaluationSummary DeserializeTextAuthoringEntityEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -137,7 +137,7 @@ internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new EntityEvaluationSummary( + return new TextAuthoringEntityEvaluationSummary( f1, precision, recall, @@ -148,43 +148,43 @@ internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonE serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEntityEvaluationSummary)} does not support writing '{options.Format}' format."); } } - EntityEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEntityEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEntityEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEntityEvaluationSummary(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEntityEvaluationSummary)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EntityEvaluationSummary FromResponse(Response response) + internal static TextAuthoringEntityEvaluationSummary FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEntityEvaluationSummary(document.RootElement); + return DeserializeTextAuthoringEntityEvaluationSummary(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.cs similarity index 82% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.cs index 9cdb7004ae61..b55f72ff2afd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEntityEvaluationSummary.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the evaluation summary for an entity. - public partial class EntityEvaluationSummary + public partial class TextAuthoringEntityEvaluationSummary { /// /// Keeps track of any properties unknown to the library. @@ -45,7 +45,7 @@ public partial class EntityEvaluationSummary /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the model precision. /// Represents the model recall. /// Represents the model F1 score. @@ -53,7 +53,7 @@ public partial class EntityEvaluationSummary /// Represents the count of true negative. /// Represents the count of false positive. /// Represents the count of false negative. - internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + internal TextAuthoringEntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) { F1 = f1; Precision = precision; @@ -64,7 +64,7 @@ internal EntityEvaluationSummary(double f1, double precision, double recall, int FalseNegativeCount = falseNegativeCount; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the model precision. /// Represents the model recall. /// Represents the model F1 score. @@ -73,7 +73,7 @@ internal EntityEvaluationSummary(double f1, double precision, double recall, int /// Represents the count of false positive. /// Represents the count of false negative. /// Keeps track of any properties unknown to the library. - internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + internal TextAuthoringEntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) { F1 = f1; Precision = precision; @@ -85,8 +85,8 @@ internal EntityEvaluationSummary(double f1, double precision, double recall, int _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EntityEvaluationSummary() + /// Initializes a new instance of for deserialization. + internal TextAuthoringEntityEvaluationSummary() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.Serialization.cs similarity index 68% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.Serialization.cs index f136f882d5bb..1d18b399c46a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class EvaluationDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringEvaluationDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationDetails)} does not support writing '{format}' format."); } if (Optional.IsDefined(Kind)) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EvaluationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEvaluationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationDetails(document.RootElement, options); + return DeserializeTextAuthoringEvaluationDetails(document.RootElement, options); } - internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringEvaluationDetails DeserializeTextAuthoringEvaluationDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,7 +86,7 @@ internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement eleme { return null; } - EvaluationKind? kind = default; + TextAuthoringEvaluationKind? kind = default; int? trainingSplitPercentage = default; int? testingSplitPercentage = default; IDictionary serializedAdditionalRawData = default; @@ -99,7 +99,7 @@ internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement eleme { continue; } - kind = new EvaluationKind(property.Value.GetString()); + kind = new TextAuthoringEvaluationKind(property.Value.GetString()); continue; } if (property.NameEquals("trainingSplitPercentage"u8)) @@ -126,46 +126,46 @@ internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new EvaluationDetails(kind, trainingSplitPercentage, testingSplitPercentage, serializedAdditionalRawData); + return new TextAuthoringEvaluationDetails(kind, trainingSplitPercentage, testingSplitPercentage, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationDetails)} does not support writing '{options.Format}' format."); } } - EvaluationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEvaluationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationDetails(document.RootElement, options); + return DeserializeTextAuthoringEvaluationDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EvaluationDetails FromResponse(Response response) + internal static TextAuthoringEvaluationDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEvaluationDetails(document.RootElement); + return DeserializeTextAuthoringEvaluationDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.cs similarity index 83% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.cs index 1fc4598f9317..a173752c827b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options used running the evaluation. - public partial class EvaluationDetails + public partial class TextAuthoringEvaluationDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class EvaluationDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public EvaluationDetails() + /// Initializes a new instance of . + public TextAuthoringEvaluationDetails() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. /// Keeps track of any properties unknown to the library. - internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) + internal TextAuthoringEvaluationDetails(TextAuthoringEvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) { Kind = kind; TrainingSplitPercentage = trainingSplitPercentage; @@ -64,7 +64,7 @@ internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, i } /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. - public EvaluationKind? Kind { get; set; } + public TextAuthoringEvaluationKind? Kind { get; set; } /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. public int? TrainingSplitPercentage { get; set; } /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.Serialization.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.Serialization.cs index 8a079924352a..bbcbf710bde7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class EvaluationJobResult : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringEvaluationJobResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationJobResult)} does not support writing '{format}' format."); } writer.WritePropertyName("evaluationOptions"u8); @@ -59,19 +59,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EvaluationJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEvaluationJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationJobResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationJobResult(document.RootElement, options); + return DeserializeTextAuthoringEvaluationJobResult(document.RootElement, options); } - internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringEvaluationJobResult DeserializeTextAuthoringEvaluationJobResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement e { return null; } - EvaluationDetails evaluationOptions = default; + TextAuthoringEvaluationDetails evaluationOptions = default; string modelLabel = default; string trainingConfigVersion = default; int percentComplete = default; @@ -89,7 +89,7 @@ internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement e { if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (property.NameEquals("modelLabel"u8)) @@ -113,46 +113,46 @@ internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData); + return new TextAuthoringEvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationJobResult)} does not support writing '{options.Format}' format."); } } - EvaluationJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEvaluationJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationJobResult(document.RootElement, options); + return DeserializeTextAuthoringEvaluationJobResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationJobResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EvaluationJobResult FromResponse(Response response) + internal static TextAuthoringEvaluationJobResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEvaluationJobResult(document.RootElement); + return DeserializeTextAuthoringEvaluationJobResult(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.cs similarity index 79% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.cs index 787dbacb2620..407ae9232799 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationJobResult.cs @@ -10,8 +10,8 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// The EvaluationJobResult. - public partial class EvaluationJobResult + /// The TextAuthoringEvaluationJobResult. + public partial class TextAuthoringEvaluationJobResult { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class EvaluationJobResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. /// , or is null. - internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) + internal TextAuthoringEvaluationJobResult(TextAuthoringEvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); Argument.AssertNotNull(modelLabel, nameof(modelLabel)); @@ -63,13 +63,13 @@ internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLa PercentComplete = percentComplete; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. /// Keeps track of any properties unknown to the library. - internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) + internal TextAuthoringEvaluationJobResult(TextAuthoringEvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) { EvaluationOptions = evaluationOptions; ModelLabel = modelLabel; @@ -78,13 +78,13 @@ internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLa _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EvaluationJobResult() + /// Initializes a new instance of for deserialization. + internal TextAuthoringEvaluationJobResult() { } /// Represents the options used running the evaluation. - public EvaluationDetails EvaluationOptions { get; } + public TextAuthoringEvaluationDetails EvaluationOptions { get; } /// Represents trained model label. public string ModelLabel { get; } /// Represents training config version. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationKind.cs new file mode 100644 index 000000000000..d644a92e105a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The TextAuthoringEvaluationKind. + public readonly partial struct TextAuthoringEvaluationKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAuthoringEvaluationKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PercentageValue = "percentage"; + private const string ManualValue = "manual"; + + /// Split the data into training and test sets according to user-defined percentages. + public static TextAuthoringEvaluationKind Percentage { get; } = new TextAuthoringEvaluationKind(PercentageValue); + /// Split the data according to the chosen dataset for every example in the data. + public static TextAuthoringEvaluationKind Manual { get; } = new TextAuthoringEvaluationKind(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringEvaluationKind left, TextAuthoringEvaluationKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringEvaluationKind left, TextAuthoringEvaluationKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAuthoringEvaluationKind(string value) => new TextAuthoringEvaluationKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAuthoringEvaluationKind other && Equals(other); + /// + public bool Equals(TextAuthoringEvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.Serialization.cs similarity index 68% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.Serialization.cs index f2db094604c4..4608f7f89611 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.AI.Language.Conversations.Authoring.Models +namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DeploymentDeleteFromResourcesJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringEvaluationOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,10 +66,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,19 +89,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentDeleteFromResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEvaluationOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringEvaluationOperationState(document.RootElement, options); } - internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDeleteFromResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringEvaluationOperationState DeserializeTextAuthoringEvaluationOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +113,10 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TextAuthoringEvaluationJobResult result = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +147,7 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +156,10 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,68 +170,74 @@ internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDelet { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; } + if (property.NameEquals("result"u8)) + { + result = TextAuthoringEvaluationJobResult.DeserializeTextAuthoringEvaluationJobResult(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentDeleteFromResourcesJobState( + return new TextAuthoringEvaluationOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationOperationState)} does not support writing '{options.Format}' format."); } } - DeploymentDeleteFromResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEvaluationOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringEvaluationOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentDeleteFromResourcesJobState FromResponse(Response response) + internal static TextAuthoringEvaluationOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement); + return DeserializeTextAuthoringEvaluationOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.cs index acecb242d3f9..3ba65294c9d2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a evaluation job. - public partial class EvaluationJobState + public partial class TextAuthoringEvaluationOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,40 +45,40 @@ public partial class EvaluationJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. /// Represents evaluation task detailed result. /// is null. - internal EvaluationJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, EvaluationJobResult result) + internal TextAuthoringEvaluationOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status, TextAuthoringEvaluationJobResult result) { Argument.AssertNotNull(result, nameof(result)); - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); Result = result; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents evaluation task detailed result. /// Keeps track of any properties unknown to the library. - internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) + internal TextAuthoringEvaluationOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, TextAuthoringEvaluationJobResult result, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; @@ -86,26 +86,26 @@ internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTi _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EvaluationJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringEvaluationOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Represents evaluation task detailed result. - public EvaluationJobResult Result { get; } + public TextAuthoringEvaluationJobResult Result { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.Serialization.cs index 56dcc54bebb9..4ae57d4bd85c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.Language.Text.Authoring.Models { - [PersistableModelProxy(typeof(UnknownEvaluationSummary))] - public partial class EvaluationSummary : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownTextAuthoringEvaluationSummary))] + public partial class TextAuthoringEvaluationSummary : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEvaluationSummary(document.RootElement, options); } - internal static EvaluationSummary DeserializeEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringEvaluationSummary DeserializeTextAuthoringEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,46 +86,46 @@ internal static EvaluationSummary DeserializeEvaluationSummary(JsonElement eleme case "CustomTextSentiment": return CustomTextSentimentEvaluationSummary.DeserializeCustomTextSentimentEvaluationSummary(element, options); } } - return UnknownEvaluationSummary.DeserializeUnknownEvaluationSummary(element, options); + return UnknownTextAuthoringEvaluationSummary.DeserializeUnknownTextAuthoringEvaluationSummary(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support writing '{options.Format}' format."); } } - EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEvaluationSummary(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EvaluationSummary FromResponse(Response response) + internal static TextAuthoringEvaluationSummary FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEvaluationSummary(document.RootElement); + return DeserializeTextAuthoringEvaluationSummary(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.cs similarity index 73% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.cs index 864f4d85893c..d859aa870c02 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringEvaluationSummary.cs @@ -12,10 +12,10 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// /// Represents the summary for an evaluation operation. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// - public abstract partial class EvaluationSummary + public abstract partial class TextAuthoringEvaluationSummary { /// /// Keeps track of any properties unknown to the library. @@ -49,35 +49,35 @@ public abstract partial class EvaluationSummary /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the options used running the evaluation. /// is null. - protected EvaluationSummary(EvaluationDetails evaluationOptions) + protected TextAuthoringEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions) { Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); EvaluationOptions = evaluationOptions; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project type that the evaluation ran on. /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. - internal EvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) + internal TextAuthoringEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; EvaluationOptions = evaluationOptions; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EvaluationSummary() + /// Initializes a new instance of for deserialization. + internal TextAuthoringEvaluationSummary() { } /// Represents the project type that the evaluation ran on. - internal ProjectKind ProjectKind { get; set; } + internal TextAuthoringProjectKind ProjectKind { get; set; } /// Represents the options used running the evaluation. - public EvaluationDetails EvaluationOptions { get; } + public TextAuthoringEvaluationDetails EvaluationOptions { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.Serialization.cs similarity index 67% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.Serialization.cs index e730c672af60..c21c44459830 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -92,19 +92,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringExportProjectOperationState(document.RootElement, options); } - internal static ExportProjectJobState DeserializeExportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportProjectOperationState DeserializeTextAuthoringExportProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -116,9 +116,9 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; string resultUrl = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -150,7 +150,7 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -159,10 +159,10 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -173,10 +173,10 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -192,55 +192,55 @@ internal static ExportProjectJobState DeserializeExportProjectJobState(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ExportProjectJobState( + return new TextAuthoringExportProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), resultUrl, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportProjectOperationState)} does not support writing '{options.Format}' format."); } } - ExportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringExportProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportProjectJobState FromResponse(Response response) + internal static TextAuthoringExportProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportProjectJobState(document.RootElement); + return DeserializeTextAuthoringExportProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.cs similarity index 60% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.cs index 9850d7221eab..c73e69699f48 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of an export job. - public partial class ExportProjectJobState + public partial class TextAuthoringExportProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,35 +45,35 @@ public partial class ExportProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ExportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringExportProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// The URL to use in order to download the exported project. /// Keeps track of any properties unknown to the library. - internal ExportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; @@ -81,25 +81,25 @@ internal ExportProjectJobState(string jobId, DateTimeOffset createdDateTime, Dat _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportProjectJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// The URL to use in order to download the exported project. public string ResultUrl { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.Serialization.cs index c5c6edab6ac1..140067108f2c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedEntity : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedEntity : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntity)} does not support writing '{format}' format."); } if (Optional.IsDefined(Category)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntity)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedEntity(document.RootElement, options); + return DeserializeTextAuthoringExportedEntity(document.RootElement, options); } - internal static ExportedEntity DeserializeExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedEntity DeserializeTextAuthoringExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -103,46 +103,46 @@ internal static ExportedEntity DeserializeExportedEntity(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedEntity(category, description, serializedAdditionalRawData); + return new TextAuthoringExportedEntity(category, description, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntity)} does not support writing '{options.Format}' format."); } } - ExportedEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedEntity(document.RootElement, options); + return DeserializeTextAuthoringExportedEntity(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntity)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedEntity FromResponse(Response response) + internal static TextAuthoringExportedEntity FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedEntity(document.RootElement); + return DeserializeTextAuthoringExportedEntity(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.cs similarity index 84% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.cs index 0d94bdbb9599..b11075d39293 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntity.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents an entity in an exported project. - public partial class ExportedEntity + public partial class TextAuthoringExportedEntity { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ExportedEntity /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ExportedEntity() + /// Initializes a new instance of . + public TextAuthoringExportedEntity() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The entity category. /// Short description for entity category. Required when enabling synthetic data generation. /// Keeps track of any properties unknown to the library. - internal ExportedEntity(string category, string description, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedEntity(string category, string description, IDictionary serializedAdditionalRawData) { Category = category; Description = description; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.Serialization.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.Serialization.cs index d531ecfb0b80..44d566b86787 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedEntityList : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedEntityList : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityList)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Sublists)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedEntityList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedEntityList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityList)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedEntityList(document.RootElement, options); + return DeserializeTextAuthoringExportedEntityList(document.RootElement, options); } - internal static ExportedEntityList DeserializeExportedEntityList(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedEntityList DeserializeTextAuthoringExportedEntityList(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,7 +81,7 @@ internal static ExportedEntityList DeserializeExportedEntityList(JsonElement ele { return null; } - IList sublists = default; + IList sublists = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,10 +92,10 @@ internal static ExportedEntityList DeserializeExportedEntityList(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ExportedEntitySublist.DeserializeExportedEntitySublist(item, options)); + array.Add(TextAuthoringExportedEntitySublist.DeserializeTextAuthoringExportedEntitySublist(item, options)); } sublists = array; continue; @@ -106,46 +106,46 @@ internal static ExportedEntityList DeserializeExportedEntityList(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedEntityList(sublists ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringExportedEntityList(sublists ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityList)} does not support writing '{options.Format}' format."); } } - ExportedEntityList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedEntityList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedEntityList(document.RootElement, options); + return DeserializeTextAuthoringExportedEntityList(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityList)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedEntityList FromResponse(Response response) + internal static TextAuthoringExportedEntityList FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedEntityList(document.RootElement); + return DeserializeTextAuthoringExportedEntityList(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.cs index 649912622cfe..b5d4d581373f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityList.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a list component of an entity. - public partial class ExportedEntityList + public partial class TextAuthoringExportedEntityList { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,22 @@ public partial class ExportedEntityList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ExportedEntityList() + /// Initializes a new instance of . + public TextAuthoringExportedEntityList() { - Sublists = new ChangeTrackingList(); + Sublists = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The sub-lists of the list component. /// Keeps track of any properties unknown to the library. - internal ExportedEntityList(IList sublists, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedEntityList(IList sublists, IDictionary serializedAdditionalRawData) { Sublists = sublists; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The sub-lists of the list component. - public IList Sublists { get; } + public IList Sublists { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.Serialization.cs index 4972bb71997d..7ff3b367c422 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedEntityListSynonym : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedEntityListSynonym : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityListSynonym)} does not support writing '{format}' format."); } if (Optional.IsDefined(Language)) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedEntityListSynonym IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedEntityListSynonym IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityListSynonym)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedEntityListSynonym(document.RootElement, options); + return DeserializeTextAuthoringExportedEntityListSynonym(document.RootElement, options); } - internal static ExportedEntityListSynonym DeserializeExportedEntityListSynonym(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedEntityListSynonym DeserializeTextAuthoringExportedEntityListSynonym(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -117,46 +117,46 @@ internal static ExportedEntityListSynonym DeserializeExportedEntityListSynonym(J } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedEntityListSynonym(language, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringExportedEntityListSynonym(language, values ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityListSynonym)} does not support writing '{options.Format}' format."); } } - ExportedEntityListSynonym IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedEntityListSynonym IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedEntityListSynonym(document.RootElement, options); + return DeserializeTextAuthoringExportedEntityListSynonym(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntityListSynonym)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedEntityListSynonym FromResponse(Response response) + internal static TextAuthoringExportedEntityListSynonym FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedEntityListSynonym(document.RootElement); + return DeserializeTextAuthoringExportedEntityListSynonym(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.cs similarity index 84% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.cs index d2ce805ef39d..35c88a961723 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntityListSynonym.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a list of synonyms inside a list component. - public partial class ExportedEntityListSynonym + public partial class TextAuthoringExportedEntityListSynonym { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class ExportedEntityListSynonym /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ExportedEntityListSynonym() + /// Initializes a new instance of . + public TextAuthoringExportedEntityListSynonym() { Values = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// The list of synonyms. /// Keeps track of any properties unknown to the library. - internal ExportedEntityListSynonym(string language, IList values, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedEntityListSynonym(string language, IList values, IDictionary serializedAdditionalRawData) { Language = language; Values = values; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.Serialization.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.Serialization.cs index a0785f2249bb..6a6206a860df 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedEntitySublist : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedEntitySublist : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntitySublist)} does not support writing '{format}' format."); } if (Optional.IsDefined(ListKey)) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedEntitySublist IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedEntitySublist IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntitySublist)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedEntitySublist(document.RootElement, options); + return DeserializeTextAuthoringExportedEntitySublist(document.RootElement, options); } - internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedEntitySublist DeserializeTextAuthoringExportedEntitySublist(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,7 +87,7 @@ internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonEleme return null; } string listKey = default; - IList synonyms = default; + IList synonyms = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,10 +103,10 @@ internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ExportedEntityListSynonym.DeserializeExportedEntityListSynonym(item, options)); + array.Add(TextAuthoringExportedEntityListSynonym.DeserializeTextAuthoringExportedEntityListSynonym(item, options)); } synonyms = array; continue; @@ -117,46 +117,46 @@ internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedEntitySublist(listKey, synonyms ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new TextAuthoringExportedEntitySublist(listKey, synonyms ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntitySublist)} does not support writing '{options.Format}' format."); } } - ExportedEntitySublist IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedEntitySublist IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedEntitySublist(document.RootElement, options); + return DeserializeTextAuthoringExportedEntitySublist(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedEntitySublist)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedEntitySublist FromResponse(Response response) + internal static TextAuthoringExportedEntitySublist FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedEntitySublist(document.RootElement); + return DeserializeTextAuthoringExportedEntitySublist(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.cs similarity index 77% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.cs index 5ae507815c1e..12e2cba7441e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedEntitySublist.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a sub-list inside a list component. - public partial class ExportedEntitySublist + public partial class TextAuthoringExportedEntitySublist { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ public partial class ExportedEntitySublist /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ExportedEntitySublist() + /// Initializes a new instance of . + public TextAuthoringExportedEntitySublist() { - Synonyms = new ChangeTrackingList(); + Synonyms = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The key of the sub-list. /// The phrases of that correspond to the sub-list. /// Keeps track of any properties unknown to the library. - internal ExportedEntitySublist(string listKey, IList synonyms, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedEntitySublist(string listKey, IList synonyms, IDictionary serializedAdditionalRawData) { ListKey = listKey; Synonyms = synonyms; @@ -65,6 +65,6 @@ internal ExportedEntitySublist(string listKey, IList /// The key of the sub-list. public string ListKey { get; set; } /// The phrases of that correspond to the sub-list. - public IList Synonyms { get; } + public IList Synonyms { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.Serialization.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.Serialization.cs index 762001abd73f..c464929a3cca 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedModelDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedModelDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("trainedModelLabel"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedModelDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedModelDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedModelDetails(document.RootElement, options); + return DeserializeTextAuthoringExportedModelDetails(document.RootElement, options); } - internal static ExportedModelDetails DeserializeExportedModelDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedModelDetails DeserializeTextAuthoringExportedModelDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,46 +89,46 @@ internal static ExportedModelDetails DeserializeExportedModelDetails(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedModelDetails(trainedModelLabel, serializedAdditionalRawData); + return new TextAuthoringExportedModelDetails(trainedModelLabel, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelDetails)} does not support writing '{options.Format}' format."); } } - ExportedModelDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedModelDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedModelDetails(document.RootElement, options); + return DeserializeTextAuthoringExportedModelDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedModelDetails FromResponse(Response response) + internal static TextAuthoringExportedModelDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedModelDetails(document.RootElement); + return DeserializeTextAuthoringExportedModelDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.cs similarity index 78% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.cs index 80920bc366c0..d1d5c4c36583 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for creating or replacing an exported model. - public partial class ExportedModelDetails + public partial class TextAuthoringExportedModelDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class ExportedModelDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The trained model label. /// is null. - public ExportedModelDetails(string trainedModelLabel) + public TextAuthoringExportedModelDetails(string trainedModelLabel) { Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); TrainedModelLabel = trainedModelLabel; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The trained model label. /// Keeps track of any properties unknown to the library. - internal ExportedModelDetails(string trainedModelLabel, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedModelDetails(string trainedModelLabel, IDictionary serializedAdditionalRawData) { TrainedModelLabel = trainedModelLabel; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedModelDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportedModelDetails() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.Serialization.cs index abc14808d6d1..d2bfad8a36c7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class DeploymentJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedModelOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DeploymentJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedModelOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentJobState(document.RootElement, options); + return DeserializeTextAuthoringExportedModelOperationState(document.RootElement, options); } - internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedModelOperationState DeserializeTextAuthoringExportedModelOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentJobState( + return new TextAuthoringExportedModelOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelOperationState)} does not support writing '{options.Format}' format."); } } - DeploymentJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedModelOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentJobState(document.RootElement, options); + return DeserializeTextAuthoringExportedModelOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedModelOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static DeploymentJobState FromResponse(Response response) + internal static TextAuthoringExportedModelOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDeploymentJobState(document.RootElement); + return DeserializeTextAuthoringExportedModelOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.cs index 2ab5ed9075b6..8ec80d804914 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedModelOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a job to create or updated an exported model. - public partial class ExportedModelJobState + public partial class TextAuthoringExportedModelOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ExportedModelJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ExportedModelJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringExportedModelOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ExportedModelJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedModelOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedModelJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportedModelOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.Serialization.cs similarity index 62% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.Serialization.cs index c2b8b8cc290c..c4205411cd7d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedPrebuiltEntity : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedPrebuiltEntity : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedPrebuiltEntity)} does not support writing '{format}' format."); } writer.WritePropertyName("category"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedPrebuiltEntity)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedPrebuiltEntity(document.RootElement, options); + return DeserializeTextAuthoringExportedPrebuiltEntity(document.RootElement, options); } - internal static ExportedPrebuiltEntity DeserializeExportedPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedPrebuiltEntity DeserializeTextAuthoringExportedPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,46 +89,46 @@ internal static ExportedPrebuiltEntity DeserializeExportedPrebuiltEntity(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedPrebuiltEntity(category, serializedAdditionalRawData); + return new TextAuthoringExportedPrebuiltEntity(category, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedPrebuiltEntity)} does not support writing '{options.Format}' format."); } } - ExportedPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedPrebuiltEntity(document.RootElement, options); + return DeserializeTextAuthoringExportedPrebuiltEntity(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedPrebuiltEntity)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedPrebuiltEntity FromResponse(Response response) + internal static TextAuthoringExportedPrebuiltEntity FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedPrebuiltEntity(document.RootElement); + return DeserializeTextAuthoringExportedPrebuiltEntity(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.cs similarity index 78% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.cs index c758f0fed070..d0b527617446 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedPrebuiltEntity.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents an exported prebuilt entity component. - public partial class ExportedPrebuiltEntity + public partial class TextAuthoringExportedPrebuiltEntity { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class ExportedPrebuiltEntity /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The prebuilt entity category. /// is null. - public ExportedPrebuiltEntity(string category) + public TextAuthoringExportedPrebuiltEntity(string category) { Argument.AssertNotNull(category, nameof(category)); Category = category; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The prebuilt entity category. /// Keeps track of any properties unknown to the library. - internal ExportedPrebuiltEntity(string category, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedPrebuiltEntity(string category, IDictionary serializedAdditionalRawData) { Category = category; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedPrebuiltEntity() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportedPrebuiltEntity() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.Serialization.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.Serialization.cs index 46e531b43506..1c5b79048008 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedProject : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedProject : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProject)} does not support writing '{format}' format."); } writer.WritePropertyName("projectFileVersion"u8); @@ -62,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedProject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedProject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProject)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedProject(document.RootElement, options); + return DeserializeTextAuthoringExportedProject(document.RootElement, options); } - internal static ExportedProject DeserializeExportedProject(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedProject DeserializeTextAuthoringExportedProject(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,8 +84,8 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, } string projectFileVersion = default; StringIndexType stringIndexType = default; - CreateProjectDetails metadata = default; - ExportedProjectAssets assets = default; + TextAuthoringCreateProjectDetails metadata = default; + TextAuthoringExportedProjectAsset assets = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -102,7 +102,7 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, } if (property.NameEquals("metadata"u8)) { - metadata = CreateProjectDetails.DeserializeCreateProjectDetails(property.Value, options); + metadata = TextAuthoringCreateProjectDetails.DeserializeTextAuthoringCreateProjectDetails(property.Value, options); continue; } if (property.NameEquals("assets"u8)) @@ -111,7 +111,7 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, { continue; } - assets = ExportedProjectAssets.DeserializeExportedProjectAssets(property.Value, options); + assets = TextAuthoringExportedProjectAsset.DeserializeTextAuthoringExportedProjectAsset(property.Value, options); continue; } if (options.Format != "W") @@ -120,46 +120,46 @@ internal static ExportedProject DeserializeExportedProject(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData); + return new TextAuthoringExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProject)} does not support writing '{options.Format}' format."); } } - ExportedProject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedProject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedProject(document.RootElement, options); + return DeserializeTextAuthoringExportedProject(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProject)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedProject FromResponse(Response response) + internal static TextAuthoringExportedProject FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedProject(document.RootElement); + return DeserializeTextAuthoringExportedProject(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.cs index ef3a9a5db83b..77dbfa75f150 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProject.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents an exported project. - public partial class ExportedProject + public partial class TextAuthoringExportedProject { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class ExportedProject /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The version of the exported file. /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. /// Represents the project metadata. /// or is null. - public ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata) + public TextAuthoringExportedProject(string projectFileVersion, StringIndexType stringIndexType, TextAuthoringCreateProjectDetails metadata) { Argument.AssertNotNull(projectFileVersion, nameof(projectFileVersion)); Argument.AssertNotNull(metadata, nameof(metadata)); @@ -60,17 +60,17 @@ public ExportedProject(string projectFileVersion, StringIndexType stringIndexTyp Metadata = metadata; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The version of the exported file. /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. /// Represents the project metadata. /// /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . /// /// Keeps track of any properties unknown to the library. - internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata, ExportedProjectAssets assets, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedProject(string projectFileVersion, StringIndexType stringIndexType, TextAuthoringCreateProjectDetails metadata, TextAuthoringExportedProjectAsset assets, IDictionary serializedAdditionalRawData) { ProjectFileVersion = projectFileVersion; StringIndexType = stringIndexType; @@ -79,8 +79,8 @@ internal ExportedProject(string projectFileVersion, StringIndexType stringIndexT _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedProject() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportedProject() { } @@ -89,12 +89,12 @@ internal ExportedProject() /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. public StringIndexType StringIndexType { get; } /// Represents the project metadata. - public CreateProjectDetails Metadata { get; } + public TextAuthoringCreateProjectDetails Metadata { get; } /// /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . /// - public ExportedProjectAssets Assets { get; set; } + public TextAuthoringExportedProjectAsset Assets { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.Serialization.cs similarity index 54% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.Serialization.cs index 19f14783dbb1..335524b8e20c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.Language.Text.Authoring.Models { - [PersistableModelProxy(typeof(UnknownExportedProjectAssets))] - public partial class ExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownTextAuthoringExportedProjectAsset))] + public partial class TextAuthoringExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support writing '{format}' format."); } writer.WritePropertyName("projectKind"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeTextAuthoringExportedProjectAsset(document.RootElement, options); } - internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedProjectAsset DeserializeTextAuthoringExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,54 +77,54 @@ internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonEleme { switch (discriminator.GetString()) { - case "CustomAbstractiveSummarization": return ExportedCustomAbstractiveSummarizationProjectAssets.DeserializeExportedCustomAbstractiveSummarizationProjectAssets(element, options); - case "CustomEntityRecognition": return ExportedCustomEntityRecognitionProjectAssets.DeserializeExportedCustomEntityRecognitionProjectAssets(element, options); - case "CustomHealthcare": return ExportedCustomHealthcareProjectAssets.DeserializeExportedCustomHealthcareProjectAssets(element, options); - case "CustomMultiLabelClassification": return ExportedCustomMultiLabelClassificationProjectAssets.DeserializeExportedCustomMultiLabelClassificationProjectAssets(element, options); - case "CustomSingleLabelClassification": return ExportedCustomSingleLabelClassificationProjectAssets.DeserializeExportedCustomSingleLabelClassificationProjectAssets(element, options); - case "CustomTextSentiment": return ExportedCustomTextSentimentProjectAssets.DeserializeExportedCustomTextSentimentProjectAssets(element, options); + case "CustomAbstractiveSummarization": return ExportedCustomAbstractiveSummarizationProjectAsset.DeserializeExportedCustomAbstractiveSummarizationProjectAsset(element, options); + case "CustomEntityRecognition": return ExportedCustomEntityRecognitionProjectAsset.DeserializeExportedCustomEntityRecognitionProjectAsset(element, options); + case "CustomHealthcare": return ExportedCustomHealthcareProjectAsset.DeserializeExportedCustomHealthcareProjectAsset(element, options); + case "CustomMultiLabelClassification": return ExportedCustomMultiLabelClassificationProjectAsset.DeserializeExportedCustomMultiLabelClassificationProjectAsset(element, options); + case "CustomSingleLabelClassification": return ExportedCustomSingleLabelClassificationProjectAsset.DeserializeExportedCustomSingleLabelClassificationProjectAsset(element, options); + case "CustomTextSentiment": return CustomTextSentimentProjectAssets.DeserializeCustomTextSentimentProjectAssets(element, options); } } - return UnknownExportedProjectAssets.DeserializeUnknownExportedProjectAssets(element, options); + return UnknownTextAuthoringExportedProjectAsset.DeserializeUnknownTextAuthoringExportedProjectAsset(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeTextAuthoringExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedProjectAssets FromResponse(Response response) + internal static TextAuthoringExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedProjectAssets(document.RootElement); + return DeserializeTextAuthoringExportedProjectAsset(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.cs index 0130e7c0af22..34109ed74149 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedProjectAsset.cs @@ -12,10 +12,10 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// /// Represents the assets of an exported project. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . /// - public abstract partial class ExportedProjectAssets + public abstract partial class TextAuthoringExportedProjectAsset { /// /// Keeps track of any properties unknown to the library. @@ -49,21 +49,21 @@ public abstract partial class ExportedProjectAssets /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected ExportedProjectAssets() + /// Initializes a new instance of . + protected TextAuthoringExportedProjectAsset() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. - internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData) { ProjectKind = projectKind; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Gets or sets the project kind. - internal ProjectKind ProjectKind { get; set; } + internal TextAuthoringProjectKind ProjectKind { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.Serialization.cs index abeb02983451..12abd58de9df 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedTrainedModel : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringExportedTrainedModel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedTrainedModel)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastExportedModelDateTime"u8); - writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WriteStringValue(LastExportedModelOn, "O"); writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedTrainedModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedTrainedModel(document.RootElement, options); + return DeserializeTextAuthoringExportedTrainedModel(document.RootElement, options); } - internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringExportedTrainedModel DeserializeTextAuthoringExportedTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -132,7 +132,7 @@ internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedTrainedModel( + return new TextAuthoringExportedTrainedModel( exportedModelName, modelId, lastTrainedDateTime, @@ -142,43 +142,43 @@ internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedTrainedModel)} does not support writing '{options.Format}' format."); } } - ExportedTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedTrainedModel(document.RootElement, options); + return DeserializeTextAuthoringExportedTrainedModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedTrainedModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedTrainedModel FromResponse(Response response) + internal static TextAuthoringExportedTrainedModel FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedTrainedModel(document.RootElement); + return DeserializeTextAuthoringExportedTrainedModel(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.cs index ab451db6dc17..f6427de9cdc5 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringExportedTrainedModel.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents an exported trained model. - public partial class ExportedTrainedModel + public partial class TextAuthoringExportedTrainedModel { /// /// Keeps track of any properties unknown to the library. @@ -45,46 +45,46 @@ public partial class ExportedTrainedModel /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. /// The model training config version. /// or is null. - internal ExportedTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + internal TextAuthoringExportedTrainedModel(string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastExportedModelOn, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastExportedModelDateTime = lastExportedModelDateTime; - ModelExpirationDate = modelExpirationDate; + LastTrainedOn = lastTrainedOn; + LastExportedModelOn = lastExportedModelOn; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The exported model name. /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. /// The model training config version. /// Keeps track of any properties unknown to the library. - internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + internal TextAuthoringExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastExportedModelOn, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) { ExportedModelName = exportedModelName; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastExportedModelDateTime = lastExportedModelDateTime; - ModelExpirationDate = modelExpirationDate; + LastTrainedOn = lastTrainedOn; + LastExportedModelOn = lastExportedModelOn; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ExportedTrainedModel() + /// Initializes a new instance of for deserialization. + internal TextAuthoringExportedTrainedModel() { } @@ -93,11 +93,11 @@ internal ExportedTrainedModel() /// The model ID. public string ModelId { get; } /// The last trained date time of the model. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// The last exported date time of the model. - public DateTimeOffset LastExportedModelDateTime { get; } + public DateTimeOffset LastExportedModelOn { get; } /// The model expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } /// The model training config version. public string ModelTrainingConfigVersion { get; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.Serialization.cs index f920a14de3e7..2e7a2d66ba6d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class CopyProjectJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringImportProjectOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringImportProjectOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CopyProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringImportProjectOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringImportProjectOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCopyProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringImportProjectOperationState(document.RootElement, options); } - internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringImportProjectOperationState DeserializeTextAuthoringImportProjectOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new CopyProjectJobState( + return new TextAuthoringImportProjectOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringImportProjectOperationState)} does not support writing '{options.Format}' format."); } } - CopyProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringImportProjectOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCopyProjectJobState(document.RootElement, options); + return DeserializeTextAuthoringImportProjectOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringImportProjectOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CopyProjectJobState FromResponse(Response response) + internal static TextAuthoringImportProjectOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCopyProjectJobState(document.RootElement); + return DeserializeTextAuthoringImportProjectOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.cs index 11931f72bd16..b1bdb10db22c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringImportProjectOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of an import job. - public partial class ImportProjectJobState + public partial class TextAuthoringImportProjectOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ImportProjectJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ImportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringImportProjectOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ImportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringImportProjectOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ImportProjectJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringImportProjectOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.Serialization.cs index 400ffa3c059b..93a804c71b70 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ExportedModelJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringLoadSnapshotOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringLoadSnapshotOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ExportedModelJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringLoadSnapshotOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringLoadSnapshotOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedModelJobState(document.RootElement, options); + return DeserializeTextAuthoringLoadSnapshotOperationState(document.RootElement, options); } - internal static ExportedModelJobState DeserializeExportedModelJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringLoadSnapshotOperationState DeserializeTextAuthoringLoadSnapshotOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static ExportedModelJobState DeserializeExportedModelJobState(JsonEleme DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static ExportedModelJobState DeserializeExportedModelJobState(JsonEleme } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static ExportedModelJobState DeserializeExportedModelJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static ExportedModelJobState DeserializeExportedModelJobState(JsonEleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static ExportedModelJobState DeserializeExportedModelJobState(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new ExportedModelJobState( + return new TextAuthoringLoadSnapshotOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringLoadSnapshotOperationState)} does not support writing '{options.Format}' format."); } } - ExportedModelJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringLoadSnapshotOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedModelJobState(document.RootElement, options); + return DeserializeTextAuthoringLoadSnapshotOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringLoadSnapshotOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ExportedModelJobState FromResponse(Response response) + internal static TextAuthoringLoadSnapshotOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeExportedModelJobState(document.RootElement); + return DeserializeTextAuthoringLoadSnapshotOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.cs index 09150def111c..473b074361c6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringLoadSnapshotOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of loading a snapshot job. - public partial class LoadSnapshotJobState + public partial class TextAuthoringLoadSnapshotOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class LoadSnapshotJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal LoadSnapshotJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringLoadSnapshotOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal LoadSnapshotJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringLoadSnapshotOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal LoadSnapshotJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringLoadSnapshotOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringOperationStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringOperationStatus.cs new file mode 100644 index 000000000000..c2a14402dedf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringOperationStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The TextAuthoringOperationStatus. + public readonly partial struct TextAuthoringOperationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAuthoringOperationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CancelledValue = "cancelled"; + private const string CancellingValue = "cancelling"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static TextAuthoringOperationStatus NotStarted { get; } = new TextAuthoringOperationStatus(NotStartedValue); + /// running. + public static TextAuthoringOperationStatus Running { get; } = new TextAuthoringOperationStatus(RunningValue); + /// succeeded. + public static TextAuthoringOperationStatus Succeeded { get; } = new TextAuthoringOperationStatus(SucceededValue); + /// failed. + public static TextAuthoringOperationStatus Failed { get; } = new TextAuthoringOperationStatus(FailedValue); + /// cancelled. + public static TextAuthoringOperationStatus Cancelled { get; } = new TextAuthoringOperationStatus(CancelledValue); + /// cancelling. + public static TextAuthoringOperationStatus Cancelling { get; } = new TextAuthoringOperationStatus(CancellingValue); + /// partiallyCompleted. + public static TextAuthoringOperationStatus PartiallyCompleted { get; } = new TextAuthoringOperationStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringOperationStatus left, TextAuthoringOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringOperationStatus left, TextAuthoringOperationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAuthoringOperationStatus(string value) => new TextAuthoringOperationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAuthoringOperationStatus other && Equals(other); + /// + public bool Equals(TextAuthoringOperationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.Serialization.cs similarity index 67% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.Serialization.cs index d10a139fae67..61d487128a84 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class PrebuiltEntity : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringPrebuiltEntity : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringPrebuiltEntity)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -60,19 +60,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - PrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringPrebuiltEntity)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePrebuiltEntity(document.RootElement, options); + return DeserializeTextAuthoringPrebuiltEntity(document.RootElement, options); } - internal static PrebuiltEntity DeserializePrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringPrebuiltEntity DeserializeTextAuthoringPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -108,46 +108,46 @@ internal static PrebuiltEntity DeserializePrebuiltEntity(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData); + return new TextAuthoringPrebuiltEntity(category, description, examples, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringPrebuiltEntity)} does not support writing '{options.Format}' format."); } } - PrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializePrebuiltEntity(document.RootElement, options); + return DeserializeTextAuthoringPrebuiltEntity(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringPrebuiltEntity)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static PrebuiltEntity FromResponse(Response response) + internal static TextAuthoringPrebuiltEntity FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializePrebuiltEntity(document.RootElement); + return DeserializeTextAuthoringPrebuiltEntity(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.cs similarity index 81% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.cs index f03feb9f25e0..c8634b4f42e2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringPrebuiltEntity.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a supported prebuilt entity. - public partial class PrebuiltEntity + public partial class TextAuthoringPrebuiltEntity { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class PrebuiltEntity /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The description. /// English examples for the entity. /// or is null. - internal PrebuiltEntity(string description, string examples) + internal TextAuthoringPrebuiltEntity(string description, string examples) { Argument.AssertNotNull(description, nameof(description)); Argument.AssertNotNull(examples, nameof(examples)); @@ -58,12 +58,12 @@ internal PrebuiltEntity(string description, string examples) Examples = examples; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The prebuilt entity category. /// The description. /// English examples for the entity. /// Keeps track of any properties unknown to the library. - internal PrebuiltEntity(string category, string description, string examples, IDictionary serializedAdditionalRawData) + internal TextAuthoringPrebuiltEntity(string category, string description, string examples, IDictionary serializedAdditionalRawData) { Category = category; Description = description; @@ -71,8 +71,8 @@ internal PrebuiltEntity(string category, string description, string examples, ID _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PrebuiltEntity() + /// Initializes a new instance of for deserialization. + internal TextAuthoringPrebuiltEntity() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.Serialization.cs index 4218bfdf7891..9b1cb20a57d1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class EvaluationJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringProjectDeletionOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeletionOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,12 +66,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } - writer.WritePropertyName("result"u8); - writer.WriteObjectValue(Result, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EvaluationJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringProjectDeletionOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeletionOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationJobState(document.RootElement, options); + return DeserializeTextAuthoringProjectDeletionOperationState(document.RootElement, options); } - internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringProjectDeletionOperationState DeserializeTextAuthoringProjectDeletionOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -113,10 +111,9 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; - EvaluationJobResult result = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -147,7 +144,7 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -156,10 +153,10 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -170,74 +167,68 @@ internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; } - if (property.NameEquals("result"u8)) - { - result = EvaluationJobResult.DeserializeEvaluationJobResult(property.Value, options); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new EvaluationJobState( + return new TextAuthoringProjectDeletionOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), - result, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeletionOperationState)} does not support writing '{options.Format}' format."); } } - EvaluationJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringProjectDeletionOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationJobState(document.RootElement, options); + return DeserializeTextAuthoringProjectDeletionOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeletionOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EvaluationJobState FromResponse(Response response) + internal static TextAuthoringProjectDeletionOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEvaluationJobState(document.RootElement); + return DeserializeTextAuthoringProjectDeletionOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.cs index fb15e24680aa..cf6dff68ed9c 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeletionOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a project deletion job. - public partial class ProjectDeletionJobState + public partial class TextAuthoringProjectDeletionOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class ProjectDeletionJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal ProjectDeletionJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringProjectDeletionOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal ProjectDeletionJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectDeletionOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectDeletionJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringProjectDeletionOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.Serialization.cs similarity index 70% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.Serialization.cs index cb308a7742e2..b3c759443183 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ProjectDeployment : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringProjectDeployment : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeployment)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WriteStringValue(LastDeployedOn, "O"); writer.WritePropertyName("deploymentExpirationDate"u8); - writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WriteStringValue(DeploymentExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); writer.WritePropertyName("assignedResources"u8); @@ -73,19 +73,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectDeployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringProjectDeployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeployment)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectDeployment(document.RootElement, options); + return DeserializeTextAuthoringProjectDeployment(document.RootElement, options); } - internal static ProjectDeployment DeserializeProjectDeployment(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringProjectDeployment DeserializeTextAuthoringProjectDeployment(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -99,7 +99,7 @@ internal static ProjectDeployment DeserializeProjectDeployment(JsonElement eleme DateTimeOffset lastDeployedDateTime = default; DateTimeOffset deploymentExpirationDate = default; string modelTrainingConfigVersion = default; - IReadOnlyList assignedResources = default; + IReadOnlyList assignedResources = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -136,10 +136,10 @@ internal static ProjectDeployment DeserializeProjectDeployment(JsonElement eleme } if (property.NameEquals("assignedResources"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeploymentResource.DeserializeDeploymentResource(item, options)); + array.Add(TextAuthoringDeploymentResource.DeserializeTextAuthoringDeploymentResource(item, options)); } assignedResources = array; continue; @@ -150,7 +150,7 @@ internal static ProjectDeployment DeserializeProjectDeployment(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectDeployment( + return new TextAuthoringProjectDeployment( deploymentName, modelId, lastTrainedDateTime, @@ -161,43 +161,43 @@ internal static ProjectDeployment DeserializeProjectDeployment(JsonElement eleme serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeployment)} does not support writing '{options.Format}' format."); } } - ProjectDeployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringProjectDeployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectDeployment(document.RootElement, options); + return DeserializeTextAuthoringProjectDeployment(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectDeployment)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectDeployment FromResponse(Response response) + internal static TextAuthoringProjectDeployment FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectDeployment(document.RootElement); + return DeserializeTextAuthoringProjectDeployment(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.cs index 80bbd68c4530..eafe87d882e3 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectDeployment.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a project deployment. - public partial class ProjectDeployment + public partial class TextAuthoringProjectDeployment { /// /// Keeps track of any properties unknown to the library. @@ -46,51 +46,51 @@ public partial class ProjectDeployment /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Represents model training config version. /// Represents the metadata of the assigned Azure resources. /// , or is null. - internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + internal TextAuthoringProjectDeployment(string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiredOn, string modelTrainingConfigVersion, IEnumerable assignedResources) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); Argument.AssertNotNull(assignedResources, nameof(assignedResources)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; + DeploymentExpiredOn = deploymentExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; AssignedResources = assignedResources.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents deployment name. /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. /// Represents model training config version. /// Represents the metadata of the assigned Azure resources. /// Keeps track of any properties unknown to the library. - internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedOn, DateTimeOffset lastDeployedOn, DateTimeOffset deploymentExpiredOn, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) { DeploymentName = deploymentName; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; - DeploymentExpirationDate = deploymentExpirationDate; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; + DeploymentExpiredOn = deploymentExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; AssignedResources = assignedResources; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectDeployment() + /// Initializes a new instance of for deserialization. + internal TextAuthoringProjectDeployment() { } @@ -99,14 +99,14 @@ internal ProjectDeployment() /// Represents deployment modelId. public string ModelId { get; } /// Represents deployment last trained time. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// Represents deployment last deployed time. - public DateTimeOffset LastDeployedDateTime { get; } + public DateTimeOffset LastDeployedOn { get; } /// Represents deployment expiration date in the runtime. - public DateTimeOffset DeploymentExpirationDate { get; } + public DateTimeOffset DeploymentExpiredOn { get; } /// Represents model training config version. public string ModelTrainingConfigVersion { get; } /// Represents the metadata of the assigned Azure resources. - public IReadOnlyList AssignedResources { get; } + public IReadOnlyList AssignedResources { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectKind.cs similarity index 53% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectKind.cs index 1128b63342ac..d7e0660f6c30 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectKind.cs @@ -10,14 +10,14 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// The ProjectKind. - public readonly partial struct ProjectKind : IEquatable + /// The TextAuthoringProjectKind. + public readonly partial struct TextAuthoringProjectKind : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public ProjectKind(string value) + public TextAuthoringProjectKind(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -30,29 +30,29 @@ public ProjectKind(string value) private const string CustomTextSentimentValue = "CustomTextSentiment"; /// For building a classification model to classify text using your own data. Each file will have only one label. For example, file 1 is classified as A and file 2 is classified as B. - public static ProjectKind CustomSingleLabelClassification { get; } = new ProjectKind(CustomSingleLabelClassificationValue); + public static TextAuthoringProjectKind CustomSingleLabelClassification { get; } = new TextAuthoringProjectKind(CustomSingleLabelClassificationValue); /// For building a classification model to classify text using your own data. Each file can have one or many labels. For example, file 1 is classified as A, B, and C and file 2 is classified as B and C. - public static ProjectKind CustomMultiLabelClassification { get; } = new ProjectKind(CustomMultiLabelClassificationValue); + public static TextAuthoringProjectKind CustomMultiLabelClassification { get; } = new TextAuthoringProjectKind(CustomMultiLabelClassificationValue); /// For building an extraction model to identify your domain categories using your own data. - public static ProjectKind CustomEntityRecognition { get; } = new ProjectKind(CustomEntityRecognitionValue); + public static TextAuthoringProjectKind CustomEntityRecognition { get; } = new TextAuthoringProjectKind(CustomEntityRecognitionValue); /// For building an abstractive summarization models which are able to summarize long documents. - public static ProjectKind CustomAbstractiveSummarization { get; } = new ProjectKind(CustomAbstractiveSummarizationValue); + public static TextAuthoringProjectKind CustomAbstractiveSummarization { get; } = new TextAuthoringProjectKind(CustomAbstractiveSummarizationValue); /// For building an text analytics for health model to identify your health domain data. - public static ProjectKind CustomHealthcare { get; } = new ProjectKind(CustomHealthcareValue); + public static TextAuthoringProjectKind CustomHealthcare { get; } = new TextAuthoringProjectKind(CustomHealthcareValue); /// For building a sentiment models which are able to extract sentiment for long documents. - public static ProjectKind CustomTextSentiment { get; } = new ProjectKind(CustomTextSentimentValue); - /// Determines if two values are the same. - public static bool operator ==(ProjectKind left, ProjectKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ProjectKind left, ProjectKind right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ProjectKind(string value) => new ProjectKind(value); + public static TextAuthoringProjectKind CustomTextSentiment { get; } = new TextAuthoringProjectKind(CustomTextSentimentValue); + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringProjectKind left, TextAuthoringProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringProjectKind left, TextAuthoringProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAuthoringProjectKind(string value) => new TextAuthoringProjectKind(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ProjectKind other && Equals(other); + public override bool Equals(object obj) => obj is TextAuthoringProjectKind other && Equals(other); /// - public bool Equals(ProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(TextAuthoringProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.Serialization.cs similarity index 74% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.Serialization.cs index a8445499979d..a34e6f85b5e8 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ProjectMetadata : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringProjectMetadata : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,25 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectMetadata)} does not support writing '{format}' format."); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastModifiedDateTime"u8); - writer.WriteStringValue(LastModifiedDateTime, "O"); - if (Optional.IsDefined(LastTrainedDateTime)) + writer.WriteStringValue(LastModifiedOn, "O"); + if (Optional.IsDefined(LastTrainedOn)) { writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + writer.WriteStringValue(LastTrainedOn.Value, "O"); } - if (Optional.IsDefined(LastDeployedDateTime)) + if (Optional.IsDefined(LastDeployedOn)) { writer.WritePropertyName("lastDeployedDateTime"u8); - writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + writer.WriteStringValue(LastDeployedOn.Value, "O"); } writer.WritePropertyName("projectKind"u8); writer.WriteStringValue(ProjectKind.ToString()); @@ -91,19 +91,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringProjectMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectMetadata)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectMetadata(document.RootElement, options); + return DeserializeTextAuthoringProjectMetadata(document.RootElement, options); } - internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringProjectMetadata DeserializeTextAuthoringProjectMetadata(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -115,9 +115,9 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, DateTimeOffset lastModifiedDateTime = default; DateTimeOffset? lastTrainedDateTime = default; DateTimeOffset? lastDeployedDateTime = default; - ProjectKind projectKind = default; + TextAuthoringProjectKind projectKind = default; string storageInputContainerName = default; - ProjectSettings settings = default; + TextAuthoringProjectSettings settings = default; string projectName = default; bool? multilingual = default; string description = default; @@ -156,7 +156,7 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, } if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("storageInputContainerName"u8)) @@ -170,7 +170,7 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, { continue; } - settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + settings = TextAuthoringProjectSettings.DeserializeTextAuthoringProjectSettings(property.Value, options); continue; } if (property.NameEquals("projectName"u8)) @@ -203,7 +203,7 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectMetadata( + return new TextAuthoringProjectMetadata( createdDateTime, lastModifiedDateTime, lastTrainedDateTime, @@ -218,43 +218,43 @@ internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectMetadata)} does not support writing '{options.Format}' format."); } } - ProjectMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringProjectMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectMetadata(document.RootElement, options); + return DeserializeTextAuthoringProjectMetadata(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectMetadata)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectMetadata FromResponse(Response response) + internal static TextAuthoringProjectMetadata FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectMetadata(document.RootElement); + return DeserializeTextAuthoringProjectMetadata(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.cs similarity index 68% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.cs index 3f8cb7abb7f0..a6bf5ec89a2f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectMetadata.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the metadata of a project. - public partial class ProjectMetadata + public partial class TextAuthoringProjectMetadata { /// /// Keeps track of any properties unknown to the library. @@ -45,30 +45,30 @@ public partial class ProjectMetadata /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project last modification datetime. + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. /// The project kind. /// The storage container name. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// or is null. - internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string storageInputContainerName, string language) + internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, TextAuthoringProjectKind projectKind, string storageInputContainerName, string language) { Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); Argument.AssertNotNull(language, nameof(language)); - CreatedDateTime = createdDateTime; - LastModifiedDateTime = lastModifiedDateTime; + CreatedOn = createdOn; + LastModifiedOn = lastModifiedOn; ProjectKind = projectKind; StorageInputContainerName = storageInputContainerName; Language = language; } - /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project last modification datetime. - /// Represents the project last training datetime. - /// Represents the project last deployment datetime. + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. /// The project kind. /// The storage container name. /// The project settings. @@ -77,12 +77,12 @@ internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModi /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectMetadata(DateTimeOffset createdOn, DateTimeOffset lastModifiedOn, DateTimeOffset? lastTrainedOn, DateTimeOffset? lastDeployedOn, TextAuthoringProjectKind projectKind, string storageInputContainerName, TextAuthoringProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) { - CreatedDateTime = createdDateTime; - LastModifiedDateTime = lastModifiedDateTime; - LastTrainedDateTime = lastTrainedDateTime; - LastDeployedDateTime = lastDeployedDateTime; + CreatedOn = createdOn; + LastModifiedOn = lastModifiedOn; + LastTrainedOn = lastTrainedOn; + LastDeployedOn = lastDeployedOn; ProjectKind = projectKind; StorageInputContainerName = storageInputContainerName; Settings = settings; @@ -93,25 +93,25 @@ internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModi _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectMetadata() + /// Initializes a new instance of for deserialization. + internal TextAuthoringProjectMetadata() { } /// Represents the project creation datetime. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// Represents the project last modification datetime. - public DateTimeOffset LastModifiedDateTime { get; } + public DateTimeOffset LastModifiedOn { get; } /// Represents the project last training datetime. - public DateTimeOffset? LastTrainedDateTime { get; } + public DateTimeOffset? LastTrainedOn { get; } /// Represents the project last deployment datetime. - public DateTimeOffset? LastDeployedDateTime { get; } + public DateTimeOffset? LastDeployedOn { get; } /// The project kind. - public ProjectKind ProjectKind { get; } + public TextAuthoringProjectKind ProjectKind { get; } /// The storage container name. public string StorageInputContainerName { get; } /// The project settings. - public ProjectSettings Settings { get; } + public TextAuthoringProjectSettings Settings { get; } /// The new project name. public string ProjectName { get; } /// Whether the project would be used for multiple languages or not. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.Serialization.cs similarity index 75% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.Serialization.cs index 87f03016db1e..7553f887cda9 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ProjectSettings : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringProjectSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectSettings)} does not support writing '{format}' format."); } if (Optional.IsDefined(ConfidenceThreshold)) @@ -76,19 +76,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectSettings(document.RootElement, options); + return DeserializeTextAuthoringProjectSettings(document.RootElement, options); } - internal static ProjectSettings DeserializeProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringProjectSettings DeserializeTextAuthoringProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -152,7 +152,7 @@ internal static ProjectSettings DeserializeProjectSettings(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectSettings( + return new TextAuthoringProjectSettings( confidenceThreshold, amlProjectPath, isLabelingLocked, @@ -161,43 +161,43 @@ internal static ProjectSettings DeserializeProjectSettings(JsonElement element, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectSettings)} does not support writing '{options.Format}' format."); } } - ProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectSettings(document.RootElement, options); + return DeserializeTextAuthoringProjectSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectSettings FromResponse(Response response) + internal static TextAuthoringProjectSettings FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectSettings(document.RootElement); + return DeserializeTextAuthoringProjectSettings(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.cs similarity index 87% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.cs index 201efeaf3dbd..6f552c9bbcb7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectSettings.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the settings used to define the project behavior. - public partial class ProjectSettings + public partial class TextAuthoringProjectSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class ProjectSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ProjectSettings() + /// Initializes a new instance of . + public TextAuthoringProjectSettings() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The threshold of the class with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. /// The path to the AML connected project. /// Indicates whether the labeling experience can be modified or not. /// Indicates whether to run GPT predictions or not. /// The predictive lookahead for GPT predictions that is specified by the user. /// Keeps track of any properties unknown to the library. - internal ProjectSettings(float? confidenceThreshold, string amlProjectPath, bool? isLabelingLocked, bool? runGptPredictions, int? gptPredictiveLookahead, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectSettings(float? confidenceThreshold, string amlProjectPath, bool? isLabelingLocked, bool? runGptPredictions, int? gptPredictiveLookahead, IDictionary serializedAdditionalRawData) { ConfidenceThreshold = confidenceThreshold; AmlProjectPath = amlProjectPath; diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.Serialization.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.Serialization.cs index 85ce49210c58..5a4a69a1bff6 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ProjectTrainedModel : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringProjectTrainedModel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectTrainedModel)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -42,11 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); writer.WritePropertyName("lastTrainedDateTime"u8); - writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WriteStringValue(LastTrainedOn, "O"); writer.WritePropertyName("lastTrainingDurationInSeconds"u8); writer.WriteNumberValue(LastTrainingDurationInSeconds); writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); writer.WritePropertyName("modelTrainingConfigVersion"u8); writer.WriteStringValue(ModelTrainingConfigVersion); writer.WritePropertyName("hasSnapshot"u8); @@ -68,19 +68,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProjectTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringProjectTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectTrainedModel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProjectTrainedModel(document.RootElement, options); + return DeserializeTextAuthoringProjectTrainedModel(document.RootElement, options); } - internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringProjectTrainedModel DeserializeTextAuthoringProjectTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -140,7 +140,7 @@ internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ProjectTrainedModel( + return new TextAuthoringProjectTrainedModel( label, modelId, lastTrainedDateTime, @@ -151,43 +151,43 @@ internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement e serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectTrainedModel)} does not support writing '{options.Format}' format."); } } - ProjectTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringProjectTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProjectTrainedModel(document.RootElement, options); + return DeserializeTextAuthoringProjectTrainedModel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringProjectTrainedModel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ProjectTrainedModel FromResponse(Response response) + internal static TextAuthoringProjectTrainedModel FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeProjectTrainedModel(document.RootElement); + return DeserializeTextAuthoringProjectTrainedModel(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.cs similarity index 72% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.cs index 18f8ba677a75..e488ce0bc6ce 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringProjectTrainedModel.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a trained model. - public partial class ProjectTrainedModel + public partial class TextAuthoringProjectTrainedModel { /// /// Keeps track of any properties unknown to the library. @@ -45,50 +45,50 @@ public partial class ProjectTrainedModel /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The model ID. - /// The last trained date time of the model. + /// The last trained date time of the model. /// The duration of the model's last training request in seconds. - /// The model expiration date. + /// The model expiration date. /// The model training config version. /// The flag to indicate if the trained model has a snapshot ready. /// or is null. - internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + internal TextAuthoringProjectTrainedModel(string modelId, DateTimeOffset lastTrainedOn, int lastTrainingDurationInSeconds, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, bool hasSnapshot) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; + LastTrainedOn = lastTrainedOn; LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; HasSnapshot = hasSnapshot; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The trained model label. /// The model ID. - /// The last trained date time of the model. + /// The last trained date time of the model. /// The duration of the model's last training request in seconds. - /// The model expiration date. + /// The model expiration date. /// The model training config version. /// The flag to indicate if the trained model has a snapshot ready. /// Keeps track of any properties unknown to the library. - internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + internal TextAuthoringProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedOn, int lastTrainingDurationInSeconds, DateTimeOffset modelExpiredOn, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) { Label = label; ModelId = modelId; - LastTrainedDateTime = lastTrainedDateTime; + LastTrainedOn = lastTrainedOn; LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; ModelTrainingConfigVersion = modelTrainingConfigVersion; HasSnapshot = hasSnapshot; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ProjectTrainedModel() + /// Initializes a new instance of for deserialization. + internal TextAuthoringProjectTrainedModel() { } @@ -97,11 +97,11 @@ internal ProjectTrainedModel() /// The model ID. public string ModelId { get; } /// The last trained date time of the model. - public DateTimeOffset LastTrainedDateTime { get; } + public DateTimeOffset LastTrainedOn { get; } /// The duration of the model's last training request in seconds. public int LastTrainingDurationInSeconds { get; } /// The model expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } /// The model training config version. public string ModelTrainingConfigVersion { get; } /// The flag to indicate if the trained model has a snapshot ready. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.Serialization.cs index 1baccdd06335..f9125abe4cc1 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class ResourceMetadata : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringResourceMetadata : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringResourceMetadata)} does not support writing '{format}' format."); } writer.WritePropertyName("azureResourceId"u8); @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringResourceMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringResourceMetadata)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceMetadata(document.RootElement, options); + return DeserializeTextAuthoringResourceMetadata(document.RootElement, options); } - internal static ResourceMetadata DeserializeResourceMetadata(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringResourceMetadata DeserializeTextAuthoringResourceMetadata(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -105,46 +105,46 @@ internal static ResourceMetadata DeserializeResourceMetadata(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new ResourceMetadata(azureResourceId, customDomain, region, serializedAdditionalRawData); + return new TextAuthoringResourceMetadata(azureResourceId, customDomain, region, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringResourceMetadata)} does not support writing '{options.Format}' format."); } } - ResourceMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringResourceMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResourceMetadata(document.RootElement, options); + return DeserializeTextAuthoringResourceMetadata(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringResourceMetadata)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ResourceMetadata FromResponse(Response response) + internal static TextAuthoringResourceMetadata FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeResourceMetadata(document.RootElement); + return DeserializeTextAuthoringResourceMetadata(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.cs similarity index 82% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.cs index b7c65fd38a96..973244b1b8e0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringResourceMetadata.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents metadata for the Azure resource.. - public partial class ResourceMetadata + public partial class TextAuthoringResourceMetadata { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class ResourceMetadata /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the Azure resource ID. /// Represents the Azure resource custom domain. /// Represents the Azure resource region. /// , or is null. - public ResourceMetadata(string azureResourceId, string customDomain, string region) + public TextAuthoringResourceMetadata(string azureResourceId, string customDomain, string region) { Argument.AssertNotNull(azureResourceId, nameof(azureResourceId)); Argument.AssertNotNull(customDomain, nameof(customDomain)); @@ -61,12 +61,12 @@ public ResourceMetadata(string azureResourceId, string customDomain, string regi Region = region; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the Azure resource ID. /// Represents the Azure resource custom domain. /// Represents the Azure resource region. /// Keeps track of any properties unknown to the library. - internal ResourceMetadata(string azureResourceId, string customDomain, string region, IDictionary serializedAdditionalRawData) + internal TextAuthoringResourceMetadata(string azureResourceId, string customDomain, string region, IDictionary serializedAdditionalRawData) { AzureResourceId = azureResourceId; CustomDomain = customDomain; @@ -74,8 +74,8 @@ internal ResourceMetadata(string azureResourceId, string customDomain, string re _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ResourceMetadata() + /// Initializes a new instance of for deserialization. + internal TextAuthoringResourceMetadata() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSentiment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSentiment.cs new file mode 100644 index 000000000000..145e4bc8fd47 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSentiment.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The TextAuthoringSentiment. + public readonly partial struct TextAuthoringSentiment : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAuthoringSentiment(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PositiveValue = "positive"; + private const string NegativeValue = "negative"; + private const string NeutralValue = "neutral"; + + /// positive. + public static TextAuthoringSentiment Positive { get; } = new TextAuthoringSentiment(PositiveValue); + /// negative. + public static TextAuthoringSentiment Negative { get; } = new TextAuthoringSentiment(NegativeValue); + /// neutral. + public static TextAuthoringSentiment Neutral { get; } = new TextAuthoringSentiment(NeutralValue); + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringSentiment left, TextAuthoringSentiment right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringSentiment left, TextAuthoringSentiment right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAuthoringSentiment(string value) => new TextAuthoringSentiment(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAuthoringSentiment other && Equals(other); + /// + public bool Equals(TextAuthoringSentiment other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.Serialization.cs index 692f5394699a..512779dd814f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class SubTrainingJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringSubTrainingOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,23 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSubTrainingOperationState)} does not support writing '{format}' format."); } writer.WritePropertyName("percentComplete"u8); writer.WriteNumberValue(PercentComplete); - if (Optional.IsDefined(StartDateTime)) + if (Optional.IsDefined(StartedOn)) { writer.WritePropertyName("startDateTime"u8); - writer.WriteStringValue(StartDateTime.Value, "O"); + writer.WriteStringValue(StartedOn.Value, "O"); } - if (Optional.IsDefined(EndDateTime)) + if (Optional.IsDefined(EndedOn)) { writer.WritePropertyName("endDateTime"u8); - writer.WriteStringValue(EndDateTime.Value, "O"); + writer.WriteStringValue(EndedOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SubTrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringSubTrainingOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSubTrainingOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSubTrainingJobState(document.RootElement, options); + return DeserializeTextAuthoringSubTrainingOperationState(document.RootElement, options); } - internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringSubTrainingOperationState DeserializeTextAuthoringSubTrainingOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e int percentComplete = default; DateTimeOffset? startDateTime = default; DateTimeOffset? endDateTime = default; - JobStatus status = default; + TextAuthoringOperationStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -118,7 +118,7 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -127,46 +127,46 @@ internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); + return new TextAuthoringSubTrainingOperationState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSubTrainingOperationState)} does not support writing '{options.Format}' format."); } } - SubTrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringSubTrainingOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSubTrainingJobState(document.RootElement, options); + return DeserializeTextAuthoringSubTrainingOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSubTrainingOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SubTrainingJobState FromResponse(Response response) + internal static TextAuthoringSubTrainingOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSubTrainingJobState(document.RootElement); + return DeserializeTextAuthoringSubTrainingOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.cs index da27123aa226..fe4a1da406dd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSubTrainingOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the detailed state of a training sub-operation. - public partial class SubTrainingJobState + public partial class TextAuthoringSubTrainingOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,42 +45,42 @@ public partial class SubTrainingJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. /// Represents the status of the sub-operation. - internal SubTrainingJobState(int percentComplete, JobStatus status) + internal TextAuthoringSubTrainingOperationState(int percentComplete, TextAuthoringOperationStatus status) { PercentComplete = percentComplete; Status = status; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. - /// Represents the start date time. - /// Represents the end date time. + /// Represents the start date time. + /// Represents the end date time. /// Represents the status of the sub-operation. /// Keeps track of any properties unknown to the library. - internal SubTrainingJobState(int percentComplete, DateTimeOffset? startDateTime, DateTimeOffset? endDateTime, JobStatus status, IDictionary serializedAdditionalRawData) + internal TextAuthoringSubTrainingOperationState(int percentComplete, DateTimeOffset? startedOn, DateTimeOffset? endedOn, TextAuthoringOperationStatus status, IDictionary serializedAdditionalRawData) { PercentComplete = percentComplete; - StartDateTime = startDateTime; - EndDateTime = endDateTime; + StartedOn = startedOn; + EndedOn = endedOn; Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SubTrainingJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringSubTrainingOperationState() { } /// Represents progress percentage. public int PercentComplete { get; } /// Represents the start date time. - public DateTimeOffset? StartDateTime { get; } + public DateTimeOffset? StartedOn { get; } /// Represents the end date time. - public DateTimeOffset? EndDateTime { get; } + public DateTimeOffset? EndedOn { get; } /// Represents the status of the sub-operation. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.Serialization.cs similarity index 65% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.Serialization.cs index 4b9ed7f539a1..b6973c9c3f25 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class SupportedLanguage : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringSupportedLanguage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSupportedLanguage)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SupportedLanguage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringSupportedLanguage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSupportedLanguage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSupportedLanguage(document.RootElement, options); + return DeserializeTextAuthoringSupportedLanguage(document.RootElement, options); } - internal static SupportedLanguage DeserializeSupportedLanguage(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringSupportedLanguage DeserializeTextAuthoringSupportedLanguage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static SupportedLanguage DeserializeSupportedLanguage(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData); + return new TextAuthoringSupportedLanguage(languageName, languageCode, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSupportedLanguage)} does not support writing '{options.Format}' format."); } } - SupportedLanguage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringSupportedLanguage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSupportedLanguage(document.RootElement, options); + return DeserializeTextAuthoringSupportedLanguage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSupportedLanguage)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SupportedLanguage FromResponse(Response response) + internal static TextAuthoringSupportedLanguage FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSupportedLanguage(document.RootElement); + return DeserializeTextAuthoringSupportedLanguage(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.cs similarity index 81% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.cs index ca301a1aafee..5c99e564955f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSupportedLanguage.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a supported language. - public partial class SupportedLanguage + public partial class TextAuthoringSupportedLanguage { /// /// Keeps track of any properties unknown to the library. @@ -45,29 +45,29 @@ public partial class SupportedLanguage /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// is null. - internal SupportedLanguage(string languageCode) + internal TextAuthoringSupportedLanguage(string languageCode) { Argument.AssertNotNull(languageCode, nameof(languageCode)); LanguageCode = languageCode; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The language name. /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal SupportedLanguage(string languageName, string languageCode, IDictionary serializedAdditionalRawData) + internal TextAuthoringSupportedLanguage(string languageName, string languageCode, IDictionary serializedAdditionalRawData) { LanguageName = languageName; LanguageCode = languageCode; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SupportedLanguage() + /// Initializes a new instance of for deserialization. + internal TextAuthoringSupportedLanguage() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.Serialization.cs index 9f6daa985967..1310914b731e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class SwapDeploymentsDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringSwapDeploymentsDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("firstDeploymentName"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SwapDeploymentsDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringSwapDeploymentsDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSwapDeploymentsDetails(document.RootElement, options); + return DeserializeTextAuthoringSwapDeploymentsDetails(document.RootElement, options); } - internal static SwapDeploymentsDetails DeserializeSwapDeploymentsDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringSwapDeploymentsDetails DeserializeTextAuthoringSwapDeploymentsDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static SwapDeploymentsDetails DeserializeSwapDeploymentsDetails(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new SwapDeploymentsDetails(firstDeploymentName, secondDeploymentName, serializedAdditionalRawData); + return new TextAuthoringSwapDeploymentsDetails(firstDeploymentName, secondDeploymentName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsDetails)} does not support writing '{options.Format}' format."); } } - SwapDeploymentsDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringSwapDeploymentsDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSwapDeploymentsDetails(document.RootElement, options); + return DeserializeTextAuthoringSwapDeploymentsDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SwapDeploymentsDetails FromResponse(Response response) + internal static TextAuthoringSwapDeploymentsDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSwapDeploymentsDetails(document.RootElement); + return DeserializeTextAuthoringSwapDeploymentsDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.cs similarity index 80% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.cs index 7c9948cf6222..4931696d16ab 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for swapping two deployments together. - public partial class SwapDeploymentsDetails + public partial class TextAuthoringSwapDeploymentsDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class SwapDeploymentsDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the first deployment name. /// Represents the second deployment name. /// or is null. - public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) + public TextAuthoringSwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) { Argument.AssertNotNull(firstDeploymentName, nameof(firstDeploymentName)); Argument.AssertNotNull(secondDeploymentName, nameof(secondDeploymentName)); @@ -58,19 +58,19 @@ public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymen SecondDeploymentName = secondDeploymentName; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the first deployment name. /// Represents the second deployment name. /// Keeps track of any properties unknown to the library. - internal SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + internal TextAuthoringSwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) { FirstDeploymentName = firstDeploymentName; SecondDeploymentName = secondDeploymentName; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SwapDeploymentsDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringSwapDeploymentsDetails() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.Serialization.cs new file mode 100644 index 000000000000..3af0bdaccea5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TextAuthoringSwapDeploymentsOperationState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsOperationState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedOn, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextAuthoringSwapDeploymentsOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsOperationState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAuthoringSwapDeploymentsOperationState(document.RootElement, options); + } + + internal static TextAuthoringSwapDeploymentsOperationState DeserializeTextAuthoringSwapDeploymentsOperationState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new TextAuthoringOperationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextAuthoringSwapDeploymentsOperationState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsOperationState)} does not support writing '{options.Format}' format."); + } + } + + TextAuthoringSwapDeploymentsOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextAuthoringSwapDeploymentsOperationState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAuthoringSwapDeploymentsOperationState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextAuthoringSwapDeploymentsOperationState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAuthoringSwapDeploymentsOperationState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.cs similarity index 58% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.cs index 76a22023a980..4c5f0b7c8e65 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringSwapDeploymentsOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a deployment job. - public partial class SwapDeploymentsJobState + public partial class TextAuthoringSwapDeploymentsOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class SwapDeploymentsJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal SwapDeploymentsJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringSwapDeploymentsOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal SwapDeploymentsJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringSwapDeploymentsOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SwapDeploymentsJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringSwapDeploymentsOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.Serialization.cs similarity index 63% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.Serialization.cs index cc67acb26600..c0d6907d577b 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class TrainingConfigVersion : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringTrainingConfigVersion : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,19 +28,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingConfigVersion)} does not support writing '{format}' format."); } if (options.Format != "W") { writer.WritePropertyName("trainingConfigVersion"u8); - writer.WriteStringValue(TrainingConfigVersionProperty); + writer.WriteStringValue(TrainingConfigVersion); } writer.WritePropertyName("modelExpirationDate"u8); - writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WriteStringValue(ModelExpiredOn, "D"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TrainingConfigVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringTrainingConfigVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingConfigVersion)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingConfigVersion(document.RootElement, options); + return DeserializeTextAuthoringTrainingConfigVersion(document.RootElement, options); } - internal static TrainingConfigVersion DeserializeTrainingConfigVersion(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringTrainingConfigVersion DeserializeTextAuthoringTrainingConfigVersion(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static TrainingConfigVersion DeserializeTrainingConfigVersion(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new TrainingConfigVersion(trainingConfigVersion, modelExpirationDate, serializedAdditionalRawData); + return new TextAuthoringTrainingConfigVersion(trainingConfigVersion, modelExpirationDate, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingConfigVersion)} does not support writing '{options.Format}' format."); } } - TrainingConfigVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringTrainingConfigVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingConfigVersion(document.RootElement, options); + return DeserializeTextAuthoringTrainingConfigVersion(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingConfigVersion)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TrainingConfigVersion FromResponse(Response response) + internal static TextAuthoringTrainingConfigVersion FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingConfigVersion(document.RootElement); + return DeserializeTextAuthoringTrainingConfigVersion(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.cs similarity index 68% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.cs index 439f9952112a..678e20bfc8fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingConfigVersion.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents a training config version. - public partial class TrainingConfigVersion + public partial class TextAuthoringTrainingConfigVersion { /// /// Keeps track of any properties unknown to the library. @@ -45,32 +45,32 @@ public partial class TrainingConfigVersion /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Represents the training config version expiration date. - internal TrainingConfigVersion(DateTimeOffset modelExpirationDate) + /// Initializes a new instance of . + /// Represents the training config version expiration date. + internal TextAuthoringTrainingConfigVersion(DateTimeOffset modelExpiredOn) { - ModelExpirationDate = modelExpirationDate; + ModelExpiredOn = modelExpiredOn; } - /// Initializes a new instance of . - /// Represents the version of the config. - /// Represents the training config version expiration date. + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. /// Keeps track of any properties unknown to the library. - internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate, IDictionary serializedAdditionalRawData) + internal TextAuthoringTrainingConfigVersion(string trainingConfigVersion, DateTimeOffset modelExpiredOn, IDictionary serializedAdditionalRawData) { - TrainingConfigVersionProperty = trainingConfigVersionProperty; - ModelExpirationDate = modelExpirationDate; + TrainingConfigVersion = trainingConfigVersion; + ModelExpiredOn = modelExpiredOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TrainingConfigVersion() + /// Initializes a new instance of for deserialization. + internal TextAuthoringTrainingConfigVersion() { } /// Represents the version of the config. - public string TrainingConfigVersionProperty { get; } + public string TrainingConfigVersion { get; } /// Represents the training config version expiration date. - public DateTimeOffset ModelExpirationDate { get; } + public DateTimeOffset ModelExpiredOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.Serialization.cs similarity index 66% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.Serialization.cs index 4b9afd2b96e2..a16c7ab914dd 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class TrainingJobDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringTrainingJobDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("modelLabel"u8); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TrainingJobDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringTrainingJobDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingJobDetails(document.RootElement, options); + return DeserializeTextAuthoringTrainingJobDetails(document.RootElement, options); } - internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringTrainingJobDetails DeserializeTextAuthoringTrainingJobDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,8 +87,8 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele } string modelLabel = default; string trainingConfigVersion = default; - EvaluationDetails evaluationOptions = default; - DataGenerationSettings dataGenerationSettings = default; + TextAuthoringEvaluationDetails evaluationOptions = default; + DataGenerationSetting dataGenerationSettings = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -109,7 +109,7 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele { continue; } - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (property.NameEquals("dataGenerationSettings"u8)) @@ -118,7 +118,7 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele { continue; } - dataGenerationSettings = DataGenerationSettings.DeserializeDataGenerationSettings(property.Value, options); + dataGenerationSettings = DataGenerationSetting.DeserializeDataGenerationSetting(property.Value, options); continue; } if (options.Format != "W") @@ -127,46 +127,46 @@ internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new TrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData); + return new TextAuthoringTrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobDetails)} does not support writing '{options.Format}' format."); } } - TrainingJobDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringTrainingJobDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingJobDetails(document.RootElement, options); + return DeserializeTextAuthoringTrainingJobDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TrainingJobDetails FromResponse(Response response) + internal static TextAuthoringTrainingJobDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingJobDetails(document.RootElement); + return DeserializeTextAuthoringTrainingJobDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.cs similarity index 83% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.cs index 2f80cac3f016..45e1cc3d9dea 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options for starting a new training job. - public partial class TrainingJobDetails + public partial class TextAuthoringTrainingJobDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class TrainingJobDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the output model label. /// Represents training config version. /// or is null. - public TrainingJobDetails(string modelLabel, string trainingConfigVersion) + public TextAuthoringTrainingJobDetails(string modelLabel, string trainingConfigVersion) { Argument.AssertNotNull(modelLabel, nameof(modelLabel)); Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); @@ -58,13 +58,13 @@ public TrainingJobDetails(string modelLabel, string trainingConfigVersion) TrainingConfigVersion = trainingConfigVersion; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the output model label. /// Represents training config version. /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. /// Represents the settings for using data generation as part of training a custom model. /// Keeps track of any properties unknown to the library. - internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, EvaluationDetails evaluationOptions, DataGenerationSettings dataGenerationSettings, IDictionary serializedAdditionalRawData) + internal TextAuthoringTrainingJobDetails(string modelLabel, string trainingConfigVersion, TextAuthoringEvaluationDetails evaluationOptions, DataGenerationSetting dataGenerationSettings, IDictionary serializedAdditionalRawData) { ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; @@ -73,8 +73,8 @@ internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, Eva _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TrainingJobDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringTrainingJobDetails() { } @@ -83,8 +83,8 @@ internal TrainingJobDetails() /// Represents training config version. public string TrainingConfigVersion { get; } /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. - public EvaluationDetails EvaluationOptions { get; set; } + public TextAuthoringEvaluationDetails EvaluationOptions { get; set; } /// Represents the settings for using data generation as part of training a custom model. - public DataGenerationSettings DataGenerationSettings { get; set; } + public DataGenerationSetting DataGenerationSettings { get; set; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.Serialization.cs similarity index 67% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.Serialization.cs index d349f1b2beb4..429a105a0f29 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class TrainingJobResult : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringTrainingJobResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobResult)} does not support writing '{format}' format."); } writer.WritePropertyName("modelLabel"u8); @@ -45,10 +45,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("evaluationStatus"u8); writer.WriteObjectValue(EvaluationStatus, options); } - if (Optional.IsDefined(EstimatedEndDateTime)) + if (Optional.IsDefined(EstimatedEndOn)) { writer.WritePropertyName("estimatedEndDateTime"u8); - writer.WriteStringValue(EstimatedEndDateTime.Value, "O"); + writer.WriteStringValue(EstimatedEndOn.Value, "O"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TrainingJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringTrainingJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingJobResult(document.RootElement, options); + return DeserializeTextAuthoringTrainingJobResult(document.RootElement, options); } - internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringTrainingJobResult DeserializeTextAuthoringTrainingJobResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,8 +89,8 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme } string modelLabel = default; string trainingConfigVersion = default; - SubTrainingJobState trainingStatus = default; - SubTrainingJobState evaluationStatus = default; + TextAuthoringSubTrainingOperationState trainingStatus = default; + TextAuthoringSubTrainingOperationState evaluationStatus = default; DateTimeOffset? estimatedEndDateTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -108,7 +108,7 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme } if (property.NameEquals("trainingStatus"u8)) { - trainingStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + trainingStatus = TextAuthoringSubTrainingOperationState.DeserializeTextAuthoringSubTrainingOperationState(property.Value, options); continue; } if (property.NameEquals("evaluationStatus"u8)) @@ -117,7 +117,7 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme { continue; } - evaluationStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + evaluationStatus = TextAuthoringSubTrainingOperationState.DeserializeTextAuthoringSubTrainingOperationState(property.Value, options); continue; } if (property.NameEquals("estimatedEndDateTime"u8)) @@ -135,7 +135,7 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new TrainingJobResult( + return new TextAuthoringTrainingJobResult( modelLabel, trainingConfigVersion, trainingStatus, @@ -144,43 +144,43 @@ internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement eleme serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobResult)} does not support writing '{options.Format}' format."); } } - TrainingJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringTrainingJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingJobResult(document.RootElement, options); + return DeserializeTextAuthoringTrainingJobResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingJobResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TrainingJobResult FromResponse(Response response) + internal static TextAuthoringTrainingJobResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingJobResult(document.RootElement); + return DeserializeTextAuthoringTrainingJobResult(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.cs similarity index 78% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.cs index 189d1d1c5a27..cd1836b75a18 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingJobResult.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the output of a training job. - public partial class TrainingJobResult + public partial class TextAuthoringTrainingJobResult { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class TrainingJobResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents trained model label. /// Represents training config version. /// Represents model train status. /// , or is null. - internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus) + internal TextAuthoringTrainingJobResult(string modelLabel, string trainingConfigVersion, TextAuthoringSubTrainingOperationState trainingStatus) { Argument.AssertNotNull(modelLabel, nameof(modelLabel)); Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); @@ -61,25 +61,25 @@ internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubT TrainingStatus = trainingStatus; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents trained model label. /// Represents training config version. /// Represents model train status. /// Represents model evaluation status. - /// Represents the estimate end date time for training and evaluation. + /// Represents the estimate end date time for training and evaluation. /// Keeps track of any properties unknown to the library. - internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + internal TextAuthoringTrainingJobResult(string modelLabel, string trainingConfigVersion, TextAuthoringSubTrainingOperationState trainingStatus, TextAuthoringSubTrainingOperationState evaluationStatus, DateTimeOffset? estimatedEndOn, IDictionary serializedAdditionalRawData) { ModelLabel = modelLabel; TrainingConfigVersion = trainingConfigVersion; TrainingStatus = trainingStatus; EvaluationStatus = evaluationStatus; - EstimatedEndDateTime = estimatedEndDateTime; + EstimatedEndOn = estimatedEndOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TrainingJobResult() + /// Initializes a new instance of for deserialization. + internal TextAuthoringTrainingJobResult() { } @@ -88,10 +88,10 @@ internal TrainingJobResult() /// Represents training config version. public string TrainingConfigVersion { get; } /// Represents model train status. - public SubTrainingJobState TrainingStatus { get; } + public TextAuthoringSubTrainingOperationState TrainingStatus { get; } /// Represents model evaluation status. - public SubTrainingJobState EvaluationStatus { get; } + public TextAuthoringSubTrainingOperationState EvaluationStatus { get; } /// Represents the estimate end date time for training and evaluation. - public DateTimeOffset? EstimatedEndDateTime { get; } + public DateTimeOffset? EstimatedEndOn { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.Serialization.cs similarity index 69% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.Serialization.cs index ec140802f56a..d043b45fcfe7 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class UnassignDeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringTrainingOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,10 +66,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,19 +89,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UnassignDeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringTrainingOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUnassignDeploymentResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringTrainingOperationState(document.RootElement, options); } - internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringTrainingOperationState DeserializeTextAuthoringTrainingOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +113,10 @@ internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymen DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TextAuthoringTrainingJobResult result = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +147,7 @@ internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymen } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +156,10 @@ internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymen { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,68 +170,74 @@ internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymen { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; } + if (property.NameEquals("result"u8)) + { + result = TextAuthoringTrainingJobResult.DeserializeTextAuthoringTrainingJobResult(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new UnassignDeploymentResourcesJobState( + return new TextAuthoringTrainingOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingOperationState)} does not support writing '{options.Format}' format."); } } - UnassignDeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringTrainingOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUnassignDeploymentResourcesJobState(document.RootElement, options); + return DeserializeTextAuthoringTrainingOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringTrainingOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static UnassignDeploymentResourcesJobState FromResponse(Response response) + internal static TextAuthoringTrainingOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnassignDeploymentResourcesJobState(document.RootElement); + return DeserializeTextAuthoringTrainingOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.cs index 70273a6d0a8b..407d73daa4fc 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringTrainingOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a training job. - public partial class TrainingJobState + public partial class TextAuthoringTrainingOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,40 +45,40 @@ public partial class TrainingJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. /// Represents training tasks detailed result. /// is null. - internal TrainingJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + internal TextAuthoringTrainingOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status, TextAuthoringTrainingJobResult result) { Argument.AssertNotNull(result, nameof(result)); - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); Result = result; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents training tasks detailed result. /// Keeps track of any properties unknown to the library. - internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + internal TextAuthoringTrainingOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, TextAuthoringTrainingJobResult result, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; @@ -86,26 +86,26 @@ internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTime _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TrainingJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringTrainingOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Represents training tasks detailed result. - public TrainingJobResult Result { get; } + public TextAuthoringTrainingJobResult Result { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.Serialization.cs similarity index 61% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.Serialization.cs index 7af5951389dc..af4effae9186 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class UnassignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringUnassignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("assignedResourceIds"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UnassignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringUnassignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + return DeserializeTextAuthoringUnassignDeploymentResourcesDetails(document.RootElement, options); } - internal static UnassignDeploymentResourcesDetails DeserializeUnassignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringUnassignDeploymentResourcesDetails DeserializeTextAuthoringUnassignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -99,46 +99,46 @@ internal static UnassignDeploymentResourcesDetails DeserializeUnassignDeployment } } serializedAdditionalRawData = rawDataDictionary; - return new UnassignDeploymentResourcesDetails(assignedResourceIds, serializedAdditionalRawData); + return new TextAuthoringUnassignDeploymentResourcesDetails(assignedResourceIds, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); } } - UnassignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringUnassignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + return DeserializeTextAuthoringUnassignDeploymentResourcesDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static UnassignDeploymentResourcesDetails FromResponse(Response response) + internal static TextAuthoringUnassignDeploymentResourcesDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnassignDeploymentResourcesDetails(document.RootElement); + return DeserializeTextAuthoringUnassignDeploymentResourcesDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.cs similarity index 76% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.cs index d124017054e1..82b3a28bdcde 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesDetails.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the options to unassign Azure resources from a project. - public partial class UnassignDeploymentResourcesDetails + public partial class TextAuthoringUnassignDeploymentResourcesDetails { /// /// Keeps track of any properties unknown to the library. @@ -46,27 +46,27 @@ public partial class UnassignDeploymentResourcesDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the assigned resource IDs to be unassigned. /// is null. - public UnassignDeploymentResourcesDetails(IEnumerable assignedResourceIds) + public TextAuthoringUnassignDeploymentResourcesDetails(IEnumerable assignedResourceIds) { Argument.AssertNotNull(assignedResourceIds, nameof(assignedResourceIds)); AssignedResourceIds = assignedResourceIds.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the assigned resource IDs to be unassigned. /// Keeps track of any properties unknown to the library. - internal UnassignDeploymentResourcesDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + internal TextAuthoringUnassignDeploymentResourcesDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) { AssignedResourceIds = assignedResourceIds; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal UnassignDeploymentResourcesDetails() + /// Initializes a new instance of for deserialization. + internal TextAuthoringUnassignDeploymentResourcesDetails() { } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.Serialization.cs similarity index 64% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.Serialization.cs index dde6e28f3bc7..7e08d3226c17 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - public partial class SwapDeploymentsJobState : IUtf8JsonSerializable, IJsonModel + public partial class TextAuthoringUnassignDeploymentResourcesOperationState : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesOperationState)} does not support writing '{format}' format."); } if (options.Format != "W") @@ -40,13 +40,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(JobId); } writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); + writer.WriteStringValue(CreatedOn, "O"); writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(ExpiresOn)) { writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); + writer.WriteStringValue(ExpiresOn.Value, "O"); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Warnings) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -66,7 +66,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in Errors) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, item); } writer.WriteEndArray(); } @@ -87,19 +87,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SwapDeploymentsJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringUnassignDeploymentResourcesOperationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesOperationState)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSwapDeploymentsJobState(document.RootElement, options); + return DeserializeTextAuthoringUnassignDeploymentResourcesOperationState(document.RootElement, options); } - internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonElement element, ModelReaderWriterOptions options = null) + internal static TextAuthoringUnassignDeploymentResourcesOperationState DeserializeTextAuthoringUnassignDeploymentResourcesOperationState(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,9 +111,9 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; + TextAuthoringOperationStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -144,7 +144,7 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE } if (property.NameEquals("status"u8)) { - status = new JobStatus(property.Value.GetString()); + status = new TextAuthoringOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("warnings"u8)) @@ -153,10 +153,10 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } warnings = array; continue; @@ -167,10 +167,10 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + array.Add(JsonSerializer.Deserialize(item.GetRawText())); } errors = array; continue; @@ -181,54 +181,54 @@ internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new SwapDeploymentsJobState( + return new TextAuthoringUnassignDeploymentResourcesOperationState( jobId, createdDateTime, lastUpdatedDateTime, expirationDateTime, status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesOperationState)} does not support writing '{options.Format}' format."); } } - SwapDeploymentsJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringUnassignDeploymentResourcesOperationState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSwapDeploymentsJobState(document.RootElement, options); + return DeserializeTextAuthoringUnassignDeploymentResourcesOperationState(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringUnassignDeploymentResourcesOperationState)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static SwapDeploymentsJobState FromResponse(Response response) + internal static TextAuthoringUnassignDeploymentResourcesOperationState FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeSwapDeploymentsJobState(document.RootElement); + return DeserializeTextAuthoringUnassignDeploymentResourcesOperationState(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.cs similarity index 57% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.cs index b37cfe90d944..76b38e5be351 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAuthoringUnassignDeploymentResourcesOperationState.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Language.Text.Authoring.Models { /// Represents the state of a unassign deployment resources job. - public partial class UnassignDeploymentResourcesJobState + public partial class TextAuthoringUnassignDeploymentResourcesOperationState { /// /// Keeps track of any properties unknown to the library. @@ -45,58 +45,58 @@ public partial class UnassignDeploymentResourcesJobState /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The creation date time of the job. - /// The last date time the job was updated. + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. /// The job status. - internal UnassignDeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + internal TextAuthoringUnassignDeploymentResourcesOperationState(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, TextAuthoringOperationStatus status) { - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; Status = status; - Warnings = new ChangeTrackingList(); - Errors = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Keeps track of any properties unknown to the library. - internal UnassignDeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + internal TextAuthoringUnassignDeploymentResourcesOperationState(string jobId, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, DateTimeOffset? expiresOn, TextAuthoringOperationStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) { JobId = jobId; - CreatedDateTime = createdDateTime; - LastUpdatedDateTime = lastUpdatedDateTime; - ExpirationDateTime = expirationDateTime; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + ExpiresOn = expiresOn; Status = status; Warnings = warnings; Errors = errors; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal UnassignDeploymentResourcesJobState() + /// Initializes a new instance of for deserialization. + internal TextAuthoringUnassignDeploymentResourcesOperationState() { } /// The job ID. public string JobId { get; } /// The creation date time of the job. - public DateTimeOffset CreatedDateTime { get; } + public DateTimeOffset CreatedOn { get; } /// The last date time the job was updated. - public DateTimeOffset LastUpdatedDateTime { get; } + public DateTimeOffset LastUpdatedOn { get; } /// The expiration date time of the job. - public DateTimeOffset? ExpirationDateTime { get; } + public DateTimeOffset? ExpiresOn { get; } /// The job status. - public JobStatus Status { get; } + public TextAuthoringOperationStatus Status { get; } /// The warnings that were encountered while executing the job. - public IReadOnlyList Warnings { get; } + public IReadOnlyList Warnings { get; } /// The errors encountered while executing the job. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs deleted file mode 100644 index 4955c000e750..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Language.Text.Authoring.Models -{ - public partial class TrainingJobState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{format}' format."); - } - - if (options.Format != "W") - { - writer.WritePropertyName("jobId"u8); - writer.WriteStringValue(JobId); - } - writer.WritePropertyName("createdDateTime"u8); - writer.WriteStringValue(CreatedDateTime, "O"); - writer.WritePropertyName("lastUpdatedDateTime"u8); - writer.WriteStringValue(LastUpdatedDateTime, "O"); - if (Optional.IsDefined(ExpirationDateTime)) - { - writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime.Value, "O"); - } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - if (Optional.IsCollectionDefined(Warnings)) - { - writer.WritePropertyName("warnings"u8); - writer.WriteStartArray(); - foreach (var item in Warnings) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Errors)) - { - writer.WritePropertyName("errors"u8); - writer.WriteStartArray(); - foreach (var item in Errors) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("result"u8); - writer.WriteObjectValue(Result, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTrainingJobState(document.RootElement, options); - } - - internal static TrainingJobState DeserializeTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobId = default; - DateTimeOffset createdDateTime = default; - DateTimeOffset lastUpdatedDateTime = default; - DateTimeOffset? expirationDateTime = default; - JobStatus status = default; - IReadOnlyList warnings = default; - IReadOnlyList errors = default; - TrainingJobResult result = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobId"u8)) - { - jobId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdDateTime"u8)) - { - createdDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastUpdatedDateTime"u8)) - { - lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationDateTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - expirationDateTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new JobStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("warnings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); - } - warnings = array; - continue; - } - if (property.NameEquals("errors"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); - } - errors = array; - continue; - } - if (property.NameEquals("result"u8)) - { - result = TrainingJobResult.DeserializeTrainingJobResult(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TrainingJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings ?? new ChangeTrackingList(), - errors ?? new ChangeTrackingList(), - result, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{options.Format}' format."); - } - } - - TrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeTrainingJobState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static TrainingJobState FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeTrainingJobState(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.Serialization.cs similarity index 56% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.Serialization.cs index 4d412ce70bd5..b124b6975305 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - internal partial class UnknownDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownTextAuthoringDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDocumentEvaluationResult(document.RootElement, options); + return DeserializeTextAuthoringDocumentEvaluationResult(document.RootElement, options); } - internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownTextAuthoringDocumentEvaluationResult DeserializeUnknownTextAuthoringDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,7 +57,7 @@ internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvalua { return null; } - ProjectKind projectKind = "Unknown"; + TextAuthoringProjectKind projectKind = "Unknown"; string location = default; string language = default; IDictionary serializedAdditionalRawData = default; @@ -66,7 +66,7 @@ internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvalua { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) @@ -85,53 +85,53 @@ internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvalua } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData); + return new UnknownTextAuthoringDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support writing '{options.Format}' format."); } } - DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDocumentEvaluationResult(document.RootElement, options); + return DeserializeTextAuthoringDocumentEvaluationResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringDocumentEvaluationResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new UnknownDocumentEvaluationResult FromResponse(Response response) + internal static new UnknownTextAuthoringDocumentEvaluationResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownDocumentEvaluationResult(document.RootElement); + return DeserializeUnknownTextAuthoringDocumentEvaluationResult(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.cs similarity index 57% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.cs index 8b2d8e34dd8e..edd2b2645021 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringDocumentEvaluationResult.cs @@ -10,20 +10,20 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// Unknown version of DocumentEvaluationResult. - internal partial class UnknownDocumentEvaluationResult : DocumentEvaluationResult + /// Unknown version of TextAuthoringDocumentEvaluationResult. + internal partial class UnknownTextAuthoringDocumentEvaluationResult : TextAuthoringDocumentEvaluationResult { - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project kind. /// Represents the document path. /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. /// Keeps track of any properties unknown to the library. - internal UnknownDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) : base(projectKind, location, language, serializedAdditionalRawData) + internal UnknownTextAuthoringDocumentEvaluationResult(TextAuthoringProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) : base(projectKind, location, language, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownDocumentEvaluationResult() + /// Initializes a new instance of for deserialization. + internal UnknownTextAuthoringDocumentEvaluationResult() { } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.Serialization.cs similarity index 54% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.Serialization.cs index d8bec44da2be..ea0a0622f787 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - internal partial class UnknownEvaluationSummary : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownTextAuthoringEvaluationSummary : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEvaluationSummary(document.RootElement, options); } - internal static UnknownEvaluationSummary DeserializeUnknownEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownTextAuthoringEvaluationSummary DeserializeUnknownTextAuthoringEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,20 +57,20 @@ internal static UnknownEvaluationSummary DeserializeUnknownEvaluationSummary(Jso { return null; } - ProjectKind projectKind = "Unknown"; - EvaluationDetails evaluationOptions = default; + TextAuthoringProjectKind projectKind = "Unknown"; + TextAuthoringEvaluationDetails evaluationOptions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (property.NameEquals("evaluationOptions"u8)) { - evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + evaluationOptions = TextAuthoringEvaluationDetails.DeserializeTextAuthoringEvaluationDetails(property.Value, options); continue; } if (options.Format != "W") @@ -79,53 +79,53 @@ internal static UnknownEvaluationSummary DeserializeUnknownEvaluationSummary(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData); + return new UnknownTextAuthoringEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support writing '{options.Format}' format."); } } - EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEvaluationSummary(document.RootElement, options); + return DeserializeTextAuthoringEvaluationSummary(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringEvaluationSummary)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new UnknownEvaluationSummary FromResponse(Response response) + internal static new UnknownTextAuthoringEvaluationSummary FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownEvaluationSummary(document.RootElement); + return DeserializeUnknownTextAuthoringEvaluationSummary(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.cs similarity index 54% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.cs index 11bd4629143a..af84921c82c2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringEvaluationSummary.cs @@ -10,19 +10,19 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// Unknown version of EvaluationSummary. - internal partial class UnknownEvaluationSummary : EvaluationSummary + /// Unknown version of TextAuthoringEvaluationSummary. + internal partial class UnknownTextAuthoringEvaluationSummary : TextAuthoringEvaluationSummary { - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project type that the evaluation ran on. /// Represents the options used running the evaluation. /// Keeps track of any properties unknown to the library. - internal UnknownEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + internal UnknownTextAuthoringEvaluationSummary(TextAuthoringProjectKind projectKind, TextAuthoringEvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) : base(projectKind, evaluationOptions, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownEvaluationSummary() + /// Initializes a new instance of for deserialization. + internal UnknownTextAuthoringEvaluationSummary() { } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.Serialization.cs similarity index 55% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.Serialization.cs index 90a43b0d5610..b2ab2ddeb5a2 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Language.Text.Authoring.Models { - internal partial class UnknownExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownTextAuthoringExportedProjectAsset : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TextAuthoringExportedProjectAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeTextAuthoringExportedProjectAsset(document.RootElement, options); } - internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownTextAuthoringExportedProjectAsset DeserializeUnknownTextAuthoringExportedProjectAsset(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,14 +57,14 @@ internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAs { return null; } - ProjectKind projectKind = "Unknown"; + TextAuthoringProjectKind projectKind = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("projectKind"u8)) { - projectKind = new ProjectKind(property.Value.GetString()); + projectKind = new TextAuthoringProjectKind(property.Value.GetString()); continue; } if (options.Format != "W") @@ -73,53 +73,53 @@ internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAs } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownExportedProjectAssets(projectKind, serializedAdditionalRawData); + return new UnknownTextAuthoringExportedProjectAsset(projectKind, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support writing '{options.Format}' format."); } } - ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TextAuthoringExportedProjectAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeExportedProjectAssets(document.RootElement, options); + return DeserializeTextAuthoringExportedProjectAsset(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TextAuthoringExportedProjectAsset)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new UnknownExportedProjectAssets FromResponse(Response response) + internal static new UnknownTextAuthoringExportedProjectAsset FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownExportedProjectAssets(document.RootElement); + return DeserializeUnknownTextAuthoringExportedProjectAsset(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.cs similarity index 50% rename from sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.cs index 590bfa73caf5..e0116e8dc13a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownTextAuthoringExportedProjectAsset.cs @@ -10,18 +10,18 @@ namespace Azure.AI.Language.Text.Authoring.Models { - /// Unknown version of ExportedProjectAssets. - internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + /// Unknown version of TextAuthoringExportedProjectAsset. + internal partial class UnknownTextAuthoringExportedProjectAsset : TextAuthoringExportedProjectAsset { - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Keeps track of any properties unknown to the library. - internal UnknownExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) + internal UnknownTextAuthoringExportedProjectAsset(TextAuthoringProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownExportedProjectAssets() + /// Initializes a new instance of for deserialization. + internal UnknownTextAuthoringExportedProjectAsset() { } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs deleted file mode 100644 index 558c6ee3dcd8..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs +++ /dev/null @@ -1,6705 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.AI.Language.Text.Authoring.Models; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.AI.Language.Text.Authoring -{ - // Data plane generated sub-client. - /// The TextAnalysisAuthoring sub-client. - public partial class TextAnalysisAuthoring - { - private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; - private readonly AzureKeyCredential _keyCredential; - private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; - private readonly TokenCredential _tokenCredential; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - 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 TextAnalysisAuthoring for mocking. - protected TextAnalysisAuthoring() - { - } - - /// Initializes a new instance of TextAnalysisAuthoring. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The key credential to copy. - /// The token credential to copy. - /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. - /// The API version to use for this operation. - internal TextAnalysisAuthoring(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) - { - ClientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - _keyCredential = keyCredential; - _tokenCredential = tokenCredential; - _endpoint = endpoint; - _apiVersion = apiVersion; - } - - /// Gets the details of a project. - /// The new project name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); - return Response.FromValue(ProjectMetadata.FromResponse(response), response); - } - - /// Gets the details of a project. - /// The new project name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetProject(projectName, context); - return Response.FromValue(ProjectMetadata.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetProjectAsync(string projectName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectRequest(projectName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetProject(string projectName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectRequest(projectName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] The most basic operation that applies to a resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] The most basic operation that applies to a resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Generates a copy project operation authorization to the current target Azure resource. - /// The new project name. - /// Represents the project kind. - /// The name of the storage container. - /// Whether to allow an existing project to be overwritten using the resulting copy authorization. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CopyProjectAuthorizationAsync(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CopyProjectAuthorizationAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(CopyProjectDetails.FromResponse(response), response); - } - - /// Generates a copy project operation authorization to the current target Azure resource. - /// The new project name. - /// Represents the project kind. - /// The name of the storage container. - /// Whether to allow an existing project to be overwritten using the resulting copy authorization. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CopyProjectAuthorization(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = CopyProjectAuthorization(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); - return Response.FromValue(CopyProjectDetails.FromResponse(response), response); - } - - /// - /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CopyProjectAuthorizationAsync(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CopyProjectAuthorization(string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing copy project job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(CopyProjectJobState.FromResponse(response), response); - } - - /// Gets the status of an existing copy project job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetCopyProjectStatus(projectName, jobId, context); - return Response.FromValue(CopyProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing copy project job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing copy project job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetCopyProjectStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of a deployment. - /// The new project name. - /// Represents deployment name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); - return Response.FromValue(ProjectDeployment.FromResponse(response), response); - } - - /// Gets the details of a deployment. - /// The new project name. - /// Represents deployment name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeployment(projectName, deploymentName, context); - return Response.FromValue(ProjectDeployment.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeployment(string projectName, string deploymentName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing delete deployment from specific resources job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing delete deployment from specific resources job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); - return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing deployment job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); - return Response.FromValue(DeploymentJobState.FromResponse(response), response); - } - - /// Gets the status of an existing deployment job. - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); - return Response.FromValue(DeploymentJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// Represents deployment name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing swap deployment job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); - } - - /// Gets the status of an existing swap deployment job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSwapDeploymentsStatus(projectName, jobId, context); - return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing swap deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing swap deployment job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, 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 new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ExportProjectJobState.FromResponse(response), response); - } - - /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportStatus(projectName, jobId, context); - return Response.FromValue(ExportProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of an exported model. - /// The new project name. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); - return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); - } - - /// Gets the details of an exported model. - /// The new project name. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportedModel(projectName, exportedModelName, context); - return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportedModel(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an existing job to create or update an exported model. - /// The new project name. - /// The exported model name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ExportedModelJobState.FromResponse(response), response); - } - - /// Gets the status for an existing job to create or update an exported model. - /// The new project name. - /// The exported model name. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); - return Response.FromValue(ExportedModelJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an existing job to create or update an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an existing job to create or update an exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The exported model name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details and URL needed to download the exported model. - /// The name of the project to use. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetExportedModelManifestAsync(projectName, exportedModelName, context).ConfigureAwait(false); - return Response.FromValue(ExportedModelManifest.FromResponse(response), response); - } - - /// Gets the details and URL needed to download the exported model. - /// The name of the project to use. - /// The exported model name. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetExportedModelManifest(projectName, exportedModelName, context); - return Response.FromValue(ExportedModelManifest.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details and URL needed to download the exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetExportedModelManifestAsync(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details and URL needed to download the exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); - scope.Start(); - try - { - using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an import. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(ImportProjectJobState.FromResponse(response), response); - } - - /// Gets the status for an import. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetImportStatus(projectName, jobId, context); - return Response.FromValue(ImportProjectJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an import. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an import. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the details of a trained model. - /// The new project name. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); - return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); - } - - /// Gets the details of a trained model. - /// The new project name. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTrainedModel(projectName, trainedModelLabel, context); - return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the details of a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the details of a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for an evaluation job. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); - return Response.FromValue(EvaluationJobState.FromResponse(response), response); - } - - /// Gets the status for an evaluation job. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); - return Response.FromValue(EvaluationJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for an evaluation job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for an evaluation job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// The name of the project to use. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); - return Response.FromValue(EvaluationSummary.FromResponse(response), response); - } - - /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// The name of the project to use. - /// The trained model label. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); - return Response.FromValue(EvaluationSummary.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); - scope.Start(); - try - { - using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for loading a snapshot. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); - return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); - } - - /// Gets the status for loading a snapshot. - /// The new project name. - /// The trained model label. - /// The job ID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); - return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for loading a snapshot. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for loading a snapshot. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing assign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(AssignDeploymentResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing assign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); - return Response.FromValue(AssignDeploymentResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing assign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing assign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status of an existing unassign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(UnassignDeploymentResourcesJobState.FromResponse(response), response); - } - - /// Gets the status of an existing unassign deployment resources job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); - return Response.FromValue(UnassignDeploymentResourcesJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status of an existing unassign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status of an existing unassign deployment resources job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for a training job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); - return Response.FromValue(TrainingJobState.FromResponse(response), response); - } - - /// Gets the status for a training job. - /// The new project name. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTrainingStatus(projectName, jobId, context); - return Response.FromValue(TrainingJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for a training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for a training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetTrainingStatus(string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the status for a project deletion job. - /// The job ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); - return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); - } - - /// Gets the status for a project deletion job. - /// The job ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetProjectDeletionStatus(jobId, context); - return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); - } - - /// - /// [Protocol Method] Gets the status for a project deletion job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task GetProjectDeletionStatusAsync(string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the status for a project deletion job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response GetProjectDeletionStatus(string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); - scope.Start(); - try - { - using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists the existing projects. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// Lists the existing projects. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the existing projects. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the existing projects. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the exported models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// Lists the exported models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the exported models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the exported models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", maxpagesize, context); - } - - /// Lists the trained models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// Lists the trained models belonging to a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the trained models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the trained models belonging to a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", maxpagesize, context); - } - - /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The trained model label. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments resources assigned to the project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments resources assigned to the project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments resources assigned to the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments resources assigned to the project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", maxpagesize, context); - } - - /// Lists the non-expired training jobs created for a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// Lists the non-expired training jobs created for a project. - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the non-expired training jobs created for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the non-expired training jobs created for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The new project name. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual Pageable GetAssignedResourceDeployments(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", maxpagesize, context); - } - - /// Lists the supported languages. - /// The project kind, default value is CustomSingleLabelClassification. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetSupportedLanguagesAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); - } - - /// Lists the supported languages. - /// The project kind, default value is CustomSingleLabelClassification. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual Pageable GetSupportedLanguages(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the supported languages. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the supported languages. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", maxpagesize, context); - } - - /// Lists the supported prebuilt entities that can be used while creating composed entities. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); - } - - /// Lists the supported prebuilt entities that can be used while creating composed entities. - /// The cancellation token to use. - /// - public virtual Pageable GetSupportedPrebuiltEntities(CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); - } - - /// - /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); - } - - /// - /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetSupportedPrebuiltEntities(RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); - } - - /// Lists the support training config version for a given project type. - /// The project kind, default value is CustomSingleLabelClassification. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual AsyncPageable GetTrainingConfigVersionsAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); - } - - /// Lists the support training config version for a given project type. - /// The project kind, default value is CustomSingleLabelClassification. - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The cancellation token to use. - /// - public virtual Pageable GetTrainingConfigVersions(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) - { - RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the support training config version for a given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); - } - - /// - /// [Protocol Method] Lists the support training config version for a given project type. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". - /// The number of result items to return. - /// The number of result items to skip. - /// The maximum number of result items per page. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", maxpagesize, context); - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteProjectRequest(projectName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Copies an existing project to another Azure resource. - /// 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. - /// The name of the project to use. - /// The copy project info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Copies an existing project to another Azure resource. - /// 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. - /// The name of the project to use. - /// The copy project info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return CopyProject(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Copies an existing project to another Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Copies an existing project to another Azure resource. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); - scope.Start(); - try - { - using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a job to export a project's data. - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); - } - - /// Triggers a job to export a project's data. - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - - RequestContext context = FromCancellationToken(cancellationToken); - return Export(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context); - } - - /// - /// [Protocol Method] Triggers a job to export a project's data. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); - scope.Start(); - try - { - using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to export a project's data. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". - /// Kind of asset to export. - /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Export(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); - scope.Start(); - try - { - using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// 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. - /// The name of the project to use. - /// The project data to import. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await ImportAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); - } - - /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// 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. - /// The name of the project to use. - /// The project data to import. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return Import(waitUntil, projectName, content, format, context); - } - - /// - /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRequest(projectName, content, format, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The content to send as the body of the request. - /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); - scope.Start(); - try - { - using HttpMessage message = CreateImportRequest(projectName, content, format, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a training job for a project. - /// 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. - /// The name of the project to use. - /// The training input parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); - } - - /// Triggers a training job for a project. - /// 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. - /// The name of the project to use. - /// The training input parameters. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = Train(waitUntil, projectName, content, context); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); - } - - /// - /// [Protocol Method] Triggers a training job for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); - scope.Start(); - try - { - using HttpMessage message = CreateTrainRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a training job for a project. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); - scope.Start(); - try - { - using HttpMessage message = CreateTrainRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Creates a new deployment or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The new deployment info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); - } - - /// Creates a new deployment or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The new deployment info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return DeployProject(waitUntil, projectName, deploymentName, content, context); - } - - /// - /// [Protocol Method] Creates a new deployment or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new deployment or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); - scope.Start(); - try - { - using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes a project deployment. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Deletes a project deployment from the specified assigned resources. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The options for deleting the deployment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); - } - - /// Deletes a project deployment from the specified assigned resources. - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The options for deleting the deployment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); - } - - /// - /// [Protocol Method] Deletes a project deployment from the specified assigned resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Deletes a project deployment from the specified assigned resources. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The name of the specific deployment of the project to use. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Swaps two existing deployments with each other. - /// 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. - /// The name of the project to use. - /// The job object to swap two deployments. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Swaps two existing deployments with each other. - /// 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. - /// The name of the project to use. - /// The job object to swap two deployments. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return SwapDeployments(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Swaps two existing deployments with each other. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Swaps two existing deployments with each other. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); - scope.Start(); - try - { - using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Creates a new exported model or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The exported model info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); - } - - /// Creates a new exported model or replaces an existing one. - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The exported model info. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); - } - - /// - /// [Protocol Method] Creates a new exported model or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Creates a new exported model or replaces an existing one. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Deletes an existing exported model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The exported model name. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); - scope.Start(); - try - { - using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers evaluation operation on a trained model. - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The training input parameters. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); - } - - /// Triggers evaluation operation on a trained model. - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The training input parameters. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); - return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); - } - - /// - /// [Protocol Method] Triggers evaluation operation on a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); - scope.Start(); - try - { - using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers evaluation operation on a trained model. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The content to send as the body of the request. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); - scope.Start(); - try - { - using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Long-running operation. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); - scope.Start(); - try - { - using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method - /// - /// [Protocol Method] Long-running operation. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The trained model label. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); - scope.Start(); - try - { - using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. - /// 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. - /// The name of the project to use. - /// The new project resources info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. - /// 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. - /// The name of the project to use. - /// The new project resources info. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return AssignDeploymentResources(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// 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. - /// The name of the project to use. - /// The info for the deployment resources to be deleted. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); - } - - /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// 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. - /// The name of the project to use. - /// The info for the deployment resources to be deleted. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(body, nameof(body)); - - using RequestContent content = body.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - return UnassignDeploymentResources(waitUntil, projectName, content, context); - } - - /// - /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); - return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// 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 of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); - scope.Start(); - try - { - using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); - return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Triggers a cancellation for a running training 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. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); - } - - /// Triggers a cancellation for a running training 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. - /// The name of the project to use. - /// The job ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); - return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); - } - - /// - /// [Protocol Method] Triggers a cancellation for a running training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Triggers a cancellation for a running training job. - /// - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// - /// Please try the simpler convenience overload with strongly typed models first. - /// - /// - /// - /// - /// 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. - /// The name of the project to use. - /// The job ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The representing an asynchronous operation on the service. - /// - public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetProjectRequest(string projectName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200201); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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/merge-patch+json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCopyProjectAuthorizationRequest(string projectName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:authorize-copy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateCopyProjectRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:copy", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateExportRequest(string projectName, string stringIndexType, string assetKind, string trainedModelLabel, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:export", false); - uri.AppendQuery("stringIndexType", stringIndexType, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (assetKind != null) - { - uri.AppendQuery("assetKind", assetKind, true); - } - if (trainedModelLabel != null) - { - uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string format, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:import", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (format != null) - { - request.Headers.Add("format", format); - } - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/:train", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetCopyProjectStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/copy/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - return message; - } - - internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - return message; - } - - internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/:delete-from-resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/delete-from-resources/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - return message; - } - - internal HttpMessage CreateSwapDeploymentsRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/:swap", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/deployments/swap/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - return message; - } - - internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier202); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendPath("/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelManifestRequest(string projectName, string exportedModelName, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/exported-models/", false); - uri.AppendPath(exportedModelName, true); - uri.AppendPath("/manifest", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/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"); - return message; - } - - internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier204); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/:evaluate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/:load-snapshot", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluate/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluation/result", false); - uri.AppendQuery("stringIndexType", stringIndexType, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/evaluation/summary-result", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/models/", false); - uri.AppendPath(trainedModelLabel, true); - uri.AppendPath("/load-snapshot/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/:assign", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateUnassignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/:unassign", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - request.Content = content; - return message; - } - - internal HttpMessage CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/assign/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/resources/unassign/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/jobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string 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("/authoring/analyze-text/projects/", false); - uri.AppendPath(projectName, true); - uri.AppendPath("/train/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; - } - - internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/global/deletion-jobs/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/global/deployments/resources", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/global/languages", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (projectKind != null) - { - uri.AppendQuery("projectKind", projectKind, true); - } - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/global/prebuilt-entities", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendPath("/authoring/analyze-text/projects/global/training-config-versions", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (projectKind != null) - { - uri.AppendQuery("projectKind", projectKind, true); - } - if (maxCount != null) - { - uri.AppendQuery("top", maxCount.Value, true); - } - if (skip != null) - { - uri.AppendQuery("skip", skip.Value, true); - } - if (maxpagesize != null) - { - uri.AppendQuery("maxpagesize", maxpagesize.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetAssignedResourceDeploymentsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - 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"); - return message; - } - - internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) - { - var message = _pipeline.CreateMessage(context, ResponseClassifier200); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRaw("/language", false); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - private static RequestContext DefaultRequestContext = new RequestContext(); - internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) - { - if (!cancellationToken.CanBeCanceled) - { - return DefaultRequestContext; - } - - return new RequestContext() { CancellationToken = cancellationToken }; - } - - private static ResponseClassifier _responseClassifier200; - private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); - private static ResponseClassifier _responseClassifier200201; - private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); - private static ResponseClassifier _responseClassifier202; - private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); - private static ResponseClassifier _responseClassifier204; - private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); - - private TrainingJobResult FetchTrainingJobResultFromTrainingJobState(Response response) - { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); - return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); - } - - private EvaluationJobResult FetchEvaluationJobResultFromEvaluationJobState(Response response) - { - var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); - return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeployments.cs new file mode 100644 index 000000000000..733911ec9446 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringDeployments.cs @@ -0,0 +1,1683 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Text.Authoring +{ + // Data plane generated sub-client. + /// The TextAuthoringDeployments sub-client. + public partial class TextAuthoringDeployments + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 TextAuthoringDeployments for mocking. + protected TextAuthoringDeployments() + { + } + + /// Initializes a new instance of TextAuthoringDeployments. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal TextAuthoringDeployments(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringProjectDeployment.FromResponse(response), response); + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeployment(projectName, deploymentName, context); + return Response.FromValue(TextAuthoringProjectDeployment.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeployment(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringDeploymentDeleteFromResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(TextAuthoringDeploymentDeleteFromResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringDeploymentOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(TextAuthoringDeploymentOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringSwapDeploymentsOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSwapDeploymentsStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringSwapDeploymentsOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringAssignDeploymentResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringAssignDeploymentResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringUnassignDeploymentResourcesOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringUnassignDeploymentResourcesOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, TextAuthoringDeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, TextAuthoringDeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Swaps two existing deployments with each other. + /// 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. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, TextAuthoringSwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Swaps two existing deployments with each other. + /// 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. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, TextAuthoringSwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return SwapDeployments(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, TextAuthoringAssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, TextAuthoringAssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return AssignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, TextAuthoringUnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, TextAuthoringUnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return UnassignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new deployment or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, TextAuthoringCreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Creates a new deployment or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, TextAuthoringCreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeployProject(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringDeployments.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringDeployments.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/:delete-from-resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/delete-from-resources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + return message; + } + + internal HttpMessage CreateSwapDeploymentsRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/:swap", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/swap/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:assign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUnassignDeploymentResourcesRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:unassign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/assign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/unassign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs index c23161239b66..6e830b55c088 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs @@ -15,11 +15,11 @@ namespace Azure.AI.Language.Text.Authoring /// Model factory for models. public static partial class TextAuthoringModelFactory { - /// Initializes a new instance of . - /// Represents the project creation datetime. - /// Represents the project last modification datetime. - /// Represents the project last training datetime. - /// Represents the project last deployment datetime. + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. /// The project kind. /// The storage container name. /// The project settings. @@ -27,14 +27,14 @@ public static partial class TextAuthoringModelFactory /// Whether the project would be used for multiple languages or not. /// The project description. /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) - { - return new ProjectMetadata( - createdDateTime, - lastModifiedDateTime, - lastTrainedDateTime, - lastDeployedDateTime, + /// A new instance for mocking. + public static TextAuthoringProjectMetadata TextAuthoringProjectMetadata(DateTimeOffset createdOn = default, DateTimeOffset lastModifiedOn = default, DateTimeOffset? lastTrainedOn = null, DateTimeOffset? lastDeployedOn = null, TextAuthoringProjectKind projectKind = default, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new TextAuthoringProjectMetadata( + createdOn, + lastModifiedOn, + lastTrainedOn, + lastDeployedOn, projectKind, storageInputContainerName, settings, @@ -45,440 +45,214 @@ public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = d serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// A human-readable representation of the error. - /// The target of the error. - /// An array of details about specific errors that led to this reported error. - /// An object containing more specific information than the current object about the error. - /// A new instance for mocking. - public static TextAnalysisAuthoringError TextAnalysisAuthoringError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) - { - details ??= new List(); - - return new TextAnalysisAuthoringError( - code, - message, - target, - details?.ToList(), - innererror, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// One of a server-defined set of error codes. - /// Error message. - /// Error details. - /// Error target. - /// An object containing more specific information than the current object about the error. - /// A new instance for mocking. - public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null) - { - details ??= new Dictionary(); - - return new InnerErrorModel( - code, - message, - details, - target, - innererror, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The project kind. - /// The storage container name. - /// The project settings. - /// The new project name. - /// Whether the project would be used for multiple languages or not. - /// The project description. - /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static CreateProjectDetails CreateProjectDetails(ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) - { - return new CreateProjectDetails( - projectKind, - storageInputContainerName, - settings, - projectName, - multilingual, - description, - language, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static TextAuthoringProjectDeployment TextAuthoringProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedOn = default, DateTimeOffset lastDeployedOn = default, DateTimeOffset deploymentExpiredOn = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) { - warnings ??= new List(); - errors ??= new List(); + assignedResources ??= new List(); - return new ProjectDeletionJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), + return new TextAuthoringProjectDeployment( + deploymentName, + modelId, + lastTrainedOn, + lastDeployedOn, + deploymentExpiredOn, + modelTrainingConfigVersion, + assignedResources?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The warning code. - /// The warning message. - /// A new instance for mocking. - public static TextAnalysisAuthoringWarning TextAnalysisAuthoringWarning(string code = null, string message = null) + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static TextAuthoringDeploymentResource TextAuthoringDeploymentResource(string resourceId = null, string region = null) { - return new TextAnalysisAuthoringWarning(code, message, serializedAdditionalRawData: null); + return new TextAuthoringDeploymentResource(resourceId, region, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static CopyProjectJobState CopyProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// A new instance for mocking. + public static TextAuthoringExportedTrainedModel TextAuthoringExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedOn = default, DateTimeOffset lastExportedModelOn = default, DateTimeOffset modelExpiredOn = default, string modelTrainingConfigVersion = null) { - warnings ??= new List(); - errors ??= new List(); - - return new CopyProjectJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), + return new TextAuthoringExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedOn, + lastExportedModelOn, + modelExpiredOn, + modelTrainingConfigVersion, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// The URL to use in order to download the exported project. - /// A new instance for mocking. - public static ExportProjectJobState ExportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static TextAuthoringProjectTrainedModel TextAuthoringProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedOn = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpiredOn = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) { - warnings ??= new List(); - errors ??= new List(); - - return new ExportProjectJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - resultUrl, + return new TextAuthoringProjectTrainedModel( + label, + modelId, + lastTrainedOn, + lastTrainingDurationInSeconds, + modelExpiredOn, + modelTrainingConfigVersion, + hasSnapshot, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The version of the exported file. - /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. - /// Represents the project metadata. - /// - /// Represents the project assets. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// A new instance for mocking. - public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectDetails metadata = null, ExportedProjectAssets assets = null) - { - return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents the summary file location in the blob store container associated with the project. - /// The location of the document in the storage. - /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// The dataset for this document. Allowed values are 'Train' and 'Test'. - /// A new instance for mocking. - public static ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// A new instance for mocking. + public static TextAuthoringAssignedDeploymentResource TextAuthoringAssignedDeploymentResource(string azureResourceId = null, string region = null) { - return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData: null); + return new TextAuthoringAssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ImportProjectJobState ImportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static TextAuthoringTrainingOperationState TextAuthoringTrainingOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TextAuthoringTrainingJobResult result = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new ImportProjectJobState( + return new TextAuthoringTrainingOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), + result, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the output model label. - /// Represents training config version. - /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. - /// Represents the settings for using data generation as part of training a custom model. - /// A new instance for mocking. - public static TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, EvaluationDetails evaluationOptions = null, DataGenerationSettings dataGenerationSettings = null) - { - return new TrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Connection type for data generation settings. Currently only supports Azure Open AI. - /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". - /// Deployment name of model to be used for synthetic data generation. - /// A new instance for mocking. - public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) - { - return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents trained model label. /// Represents training config version. /// Represents model train status. /// Represents model evaluation status. - /// Represents the estimate end date time for training and evaluation. - /// A new instance for mocking. - public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + /// Represents the estimate end date time for training and evaluation. + /// A new instance for mocking. + public static TextAuthoringTrainingJobResult TextAuthoringTrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, TextAuthoringSubTrainingOperationState trainingStatus = null, TextAuthoringSubTrainingOperationState evaluationStatus = null, DateTimeOffset? estimatedEndOn = null) { - return new TrainingJobResult( + return new TextAuthoringTrainingJobResult( modelLabel, trainingConfigVersion, trainingStatus, evaluationStatus, - estimatedEndDateTime, + estimatedEndOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents progress percentage. - /// Represents the start date time. - /// Represents the end date time. + /// Represents the start date time. + /// Represents the end date time. /// Represents the status of the sub-operation. - /// A new instance for mocking. - public static SubTrainingJobState SubTrainingJobState(int percentComplete = default, DateTimeOffset? startDateTime = null, DateTimeOffset? endDateTime = null, JobStatus status = default) - { - return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// Represents training tasks detailed result. - /// A new instance for mocking. - public static TrainingJobState TrainingJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) - { - warnings ??= new List(); - errors ??= new List(); - - return new TrainingJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - result, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents deployment name. - /// Represents deployment modelId. - /// Represents deployment last trained time. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. - /// Represents model training config version. - /// Represents the metadata of the assigned Azure resources. - /// A new instance for mocking. - public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + /// A new instance for mocking. + public static TextAuthoringSubTrainingOperationState TextAuthoringSubTrainingOperationState(int percentComplete = default, DateTimeOffset? startedOn = null, DateTimeOffset? endedOn = null, TextAuthoringOperationStatus status = default) { - assignedResources ??= new List(); - - return new ProjectDeployment( - deploymentName, - modelId, - lastTrainedDateTime, - lastDeployedDateTime, - deploymentExpirationDate, - modelTrainingConfigVersion, - assignedResources?.ToList(), - serializedAdditionalRawData: null); + return new TextAuthoringSubTrainingOperationState(percentComplete, startedOn, endedOn, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the Azure resource Id. - /// Represents the resource region. - /// A new instance for mocking. - public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) - { - return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Represents the trained model label. - /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. - /// A new instance for mocking. - public static CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// A new instance for mocking. + public static TextAuthoringAssignedProjectDeploymentsMetadata TextAuthoringAssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) { - assignedResourceIds ??= new List(); + deploymentsMetadata ??= new List(); - return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + return new TextAuthoringAssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static DeploymentJobState DeploymentJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// A new instance for mocking. + public static TextAuthoringAssignedProjectDeploymentMetadata TextAuthoringAssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedOn = default, DateTimeOffset deploymentExpiresOn = default) { - warnings ??= new List(); - errors ??= new List(); - - return new DeploymentJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); + return new TextAuthoringAssignedProjectDeploymentMetadata(deploymentName, lastDeployedOn, deploymentExpiresOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static TextAuthoringSupportedLanguage TextAuthoringSupportedLanguage(string languageName = null, string languageCode = null) { - warnings ??= new List(); - errors ??= new List(); - - return new DeploymentDeleteFromResourcesJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); + return new TextAuthoringSupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. - /// The job status. - /// The warnings that were encountered while executing the job. - /// The errors encountered while executing the job. - /// A new instance for mocking. - public static SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// A new instance for mocking. + public static TextAuthoringPrebuiltEntity TextAuthoringPrebuiltEntity(string category = null, string description = null, string examples = null) { - warnings ??= new List(); - errors ??= new List(); - - return new SwapDeploymentsJobState( - jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, - status, - warnings?.ToList(), - errors?.ToList(), - serializedAdditionalRawData: null); + return new TextAuthoringPrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The exported model name. - /// The model ID. - /// The last trained date time of the model. - /// The last exported date time of the model. - /// The model expiration date. - /// The model training config version. - /// A new instance for mocking. - public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// A new instance for mocking. + public static TextAuthoringTrainingConfigVersion TextAuthoringTrainingConfigVersion(string trainingConfigVersion = null, DateTimeOffset modelExpiredOn = default) { - return new ExportedTrainedModel( - exportedModelName, - modelId, - lastTrainedDateTime, - lastExportedModelDateTime, - modelExpirationDate, - modelTrainingConfigVersion, - serializedAdditionalRawData: null); + return new TextAuthoringTrainingConfigVersion(trainingConfigVersion, modelExpiredOn, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static ExportedModelJobState ExportedModelJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static TextAuthoringExportedModelOperationState TextAuthoringExportedModelOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new ExportedModelJobState( + return new TextAuthoringExportedModelOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), @@ -504,59 +278,37 @@ public static ModelFile ModelFile(string name = null, Uri contentUri = null) return new ModelFile(name, contentUri, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The trained model label. - /// The model ID. - /// The last trained date time of the model. - /// The duration of the model's last training request in seconds. - /// The model expiration date. - /// The model training config version. - /// The flag to indicate if the trained model has a snapshot ready. - /// A new instance for mocking. - public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) - { - return new ProjectTrainedModel( - label, - modelId, - lastTrainedDateTime, - lastTrainingDurationInSeconds, - modelExpirationDate, - modelTrainingConfigVersion, - hasSnapshot, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Represents trained model label. /// Represents training config version. /// Represents progress percentage. - /// A new instance for mocking. - public static EvaluationJobResult EvaluationJobResult(EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) + /// A new instance for mocking. + public static TextAuthoringEvaluationJobResult TextAuthoringEvaluationJobResult(TextAuthoringEvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) { - return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); + return new TextAuthoringEvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. /// Represents evaluation task detailed result. - /// A new instance for mocking. - public static EvaluationJobState EvaluationJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) + /// A new instance for mocking. + public static TextAuthoringEvaluationOperationState TextAuthoringEvaluationOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TextAuthoringEvaluationJobResult result = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new EvaluationJobState( + return new TextAuthoringEvaluationOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), @@ -564,39 +316,39 @@ public static EvaluationJobState EvaluationJobState(string jobId = null, DateTim serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static TextAuthoringLoadSnapshotOperationState TextAuthoringLoadSnapshotOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new LoadSnapshotJobState( + return new TextAuthoringLoadSnapshotOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project kind. /// Represents the document path. /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static DocumentEvaluationResult DocumentEvaluationResult(string projectKind = null, string location = null, string language = null) + /// A new instance for mocking. + public static TextAuthoringDocumentEvaluationResult TextAuthoringDocumentEvaluationResult(string projectKind = null, string location = null, string language = null) { - return new UnknownDocumentEvaluationResult(projectKind == null ? default : new ProjectKind(projectKind), location, language, serializedAdditionalRawData: null); + return new UnknownTextAuthoringDocumentEvaluationResult(projectKind == null ? default : new TextAuthoringProjectKind(projectKind), location, language, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -606,7 +358,7 @@ public static DocumentEvaluationResult DocumentEvaluationResult(string projectKi /// A new instance for mocking. public static CustomEntityRecognitionDocumentEvaluationResult CustomEntityRecognitionDocumentEvaluationResult(string location = null, string language = null, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null) { - return new CustomEntityRecognitionDocumentEvaluationResult(ProjectKind.CustomEntityRecognition, location, language, serializedAdditionalRawData: null, customEntityRecognitionResult); + return new CustomEntityRecognitionDocumentEvaluationResult(TextAuthoringProjectKind.CustomEntityRecognition, location, language, serializedAdditionalRawData: null, customEntityRecognitionResult); } /// Initializes a new instance of . @@ -650,7 +402,7 @@ public static DocumentEntityLabelEvaluationResult DocumentEntityLabelEvaluationR /// A new instance for mocking. public static CustomHealthcareDocumentEvaluationResult CustomHealthcareDocumentEvaluationResult(string location = null, string language = null, DocumentHealthcareEvaluationResult customHealthcareResult = null) { - return new CustomHealthcareDocumentEvaluationResult(ProjectKind.CustomHealthcare, location, language, serializedAdditionalRawData: null, customHealthcareResult); + return new CustomHealthcareDocumentEvaluationResult(TextAuthoringProjectKind.CustomHealthcare, location, language, serializedAdditionalRawData: null, customHealthcareResult); } /// Initializes a new instance of . @@ -670,7 +422,7 @@ public static DocumentHealthcareEvaluationResult DocumentHealthcareEvaluationRes /// A new instance for mocking. public static CustomMultiLabelClassificationDocumentEvaluationResult CustomMultiLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = null) { - return new CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind.CustomMultiLabelClassification, location, language, serializedAdditionalRawData: null, customMultiLabelClassificationResult); + return new CustomMultiLabelClassificationDocumentEvaluationResult(TextAuthoringProjectKind.CustomMultiLabelClassification, location, language, serializedAdditionalRawData: null, customMultiLabelClassificationResult); } /// Initializes a new instance of . @@ -692,7 +444,7 @@ public static DocumentMultiLabelClassificationEvaluationResult DocumentMultiLabe /// A new instance for mocking. public static CustomSingleLabelClassificationDocumentEvaluationResult CustomSingleLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = null) { - return new CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind.CustomSingleLabelClassification, location, language, serializedAdditionalRawData: null, customSingleLabelClassificationResult); + return new CustomSingleLabelClassificationDocumentEvaluationResult(TextAuthoringProjectKind.CustomSingleLabelClassification, location, language, serializedAdditionalRawData: null, customSingleLabelClassificationResult); } /// Initializes a new instance of . @@ -711,7 +463,7 @@ public static DocumentSingleLabelClassificationEvaluationResult DocumentSingleLa /// A new instance for mocking. public static CustomTextSentimentDocumentEvaluationResult CustomTextSentimentDocumentEvaluationResult(string location = null, string language = null, DocumentTextSentimentEvaluationResult customTextSentimentResult = null) { - return new CustomTextSentimentDocumentEvaluationResult(ProjectKind.CustomTextSentiment, location, language, serializedAdditionalRawData: null, customTextSentimentResult); + return new CustomTextSentimentDocumentEvaluationResult(TextAuthoringProjectKind.CustomTextSentiment, location, language, serializedAdditionalRawData: null, customTextSentimentResult); } /// Initializes a new instance of . @@ -731,27 +483,27 @@ public static DocumentTextSentimentEvaluationResult DocumentTextSentimentEvaluat /// Represents the sentiment offset index relative to the original text. /// Represents the sentiment length. /// A new instance for mocking. - public static DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category = default, int offset = default, int length = default) + public static DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(TextAuthoringSentiment category = default, int offset = default, int length = default) { return new DocumentSentimentLabelEvaluationResult(category, offset, length, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the project type that the evaluation ran on. /// Represents the options used running the evaluation. - /// A new instance for mocking. - public static EvaluationSummary EvaluationSummary(string projectKind = null, EvaluationDetails evaluationOptions = null) + /// A new instance for mocking. + public static TextAuthoringEvaluationSummary TextAuthoringEvaluationSummary(string projectKind = null, TextAuthoringEvaluationDetails evaluationOptions = null) { - return new UnknownEvaluationSummary(projectKind == null ? default : new ProjectKind(projectKind), evaluationOptions, serializedAdditionalRawData: null); + return new UnknownTextAuthoringEvaluationSummary(projectKind == null ? default : new TextAuthoringProjectKind(projectKind), evaluationOptions, serializedAdditionalRawData: null); } /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to extraction evaluation. /// A new instance for mocking. - public static CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(EvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) + public static CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) { - return new CustomEntityRecognitionEvaluationSummary(ProjectKind.CustomEntityRecognition, evaluationOptions, serializedAdditionalRawData: null, customEntityRecognitionEvaluation); + return new CustomEntityRecognitionEvaluationSummary(TextAuthoringProjectKind.CustomEntityRecognition, evaluationOptions, serializedAdditionalRawData: null, customEntityRecognitionEvaluation); } /// Initializes a new instance of . @@ -764,9 +516,10 @@ public static CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEv /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// A new instance for mocking. - public static EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + public static EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(IReadOnlyDictionary confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) { - entities ??= new Dictionary(); + confusionMatrix ??= new Dictionary(); + entities ??= new Dictionary(); return new EntityRecognitionEvaluationSummary( confusionMatrix, @@ -780,36 +533,26 @@ public static EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSumm serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Additional Properties. - /// A new instance for mocking. - public static ConfusionMatrix ConfusionMatrix(IReadOnlyDictionary additionalProperties = null) + /// A new instance for mocking. + public static TextAuthoringConfusionMatrixRow TextAuthoringConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) { additionalProperties ??= new Dictionary(); - return new ConfusionMatrix(additionalProperties); + return new TextAuthoringConfusionMatrixRow(additionalProperties); } - /// Initializes a new instance of . - /// Additional Properties. - /// A new instance for mocking. - public static ConfusionMatrixRow ConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) - { - additionalProperties ??= new Dictionary(); - - return new ConfusionMatrixRow(additionalProperties); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents normalized value in percentages. /// Represents raw value. - /// A new instance for mocking. - public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = default, float rawValue = default) + /// A new instance for mocking. + public static TextAuthoringConfusionMatrixCell TextAuthoringConfusionMatrixCell(float normalizedValue = default, float rawValue = default) { - return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); + return new TextAuthoringConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Represents the model precision. /// Represents the model recall. /// Represents the model F1 score. @@ -817,10 +560,10 @@ public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = de /// Represents the count of true negative. /// Represents the count of false positive. /// Represents the count of false negative. - /// A new instance for mocking. - public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + /// A new instance for mocking. + public static TextAuthoringEntityEvaluationSummary TextAuthoringEntityEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) { - return new EntityEvaluationSummary( + return new TextAuthoringEntityEvaluationSummary( f1, precision, recall, @@ -835,18 +578,18 @@ public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = defaul /// Represents the options used running the evaluation. /// Contains the data related to health care evaluation. /// A new instance for mocking. - public static CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(EvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) + public static CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) { - return new CustomHealthcareEvaluationSummary(ProjectKind.CustomHealthcare, evaluationOptions, serializedAdditionalRawData: null, customHealthcareEvaluation); + return new CustomHealthcareEvaluationSummary(TextAuthoringProjectKind.CustomHealthcare, evaluationOptions, serializedAdditionalRawData: null, customHealthcareEvaluation); } /// Initializes a new instance of . /// Represents the options used running the evaluation. /// Contains the data related to multi label classification evaluation. /// A new instance for mocking. - public static CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions = null, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) + public static CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions = null, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) { - return new CustomMultiLabelClassificationEvaluationSummary(ProjectKind.CustomMultiLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customMultiLabelClassificationEvaluation); + return new CustomMultiLabelClassificationEvaluationSummary(TextAuthoringProjectKind.CustomMultiLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customMultiLabelClassificationEvaluation); } /// Initializes a new instance of . @@ -899,9 +642,9 @@ public static MultiLabelClassEvaluationSummary MultiLabelClassEvaluationSummary( /// Represents the options used running the evaluation. /// Contains the data related to single label classification evaluation. /// A new instance for mocking. - public static CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions = null, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) + public static CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions = null, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) { - return new CustomSingleLabelClassificationEvaluationSummary(ProjectKind.CustomSingleLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customSingleLabelClassificationEvaluation); + return new CustomSingleLabelClassificationEvaluationSummary(TextAuthoringProjectKind.CustomSingleLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customSingleLabelClassificationEvaluation); } /// Initializes a new instance of . @@ -914,8 +657,9 @@ public static CustomSingleLabelClassificationEvaluationSummary CustomSingleLabel /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// A new instance for mocking. - public static SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + public static SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(IReadOnlyDictionary confusionMatrix = null, IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) { + confusionMatrix ??= new Dictionary(); classes ??= new Dictionary(); return new SingleLabelClassificationEvaluationSummary( @@ -956,9 +700,9 @@ public static SingleLabelClassEvaluationSummary SingleLabelClassEvaluationSummar /// Represents the options used running the evaluation. /// Contains the data related to custom sentiment evaluation. /// A new instance for mocking. - public static CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(EvaluationDetails evaluationOptions = null, TextSentimentEvaluationSummary customTextSentimentEvaluation = null) + public static CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(TextAuthoringEvaluationDetails evaluationOptions = null, TextSentimentEvaluationSummary customTextSentimentEvaluation = null) { - return new CustomTextSentimentEvaluationSummary(ProjectKind.CustomTextSentiment, evaluationOptions, serializedAdditionalRawData: null, customTextSentimentEvaluation); + return new CustomTextSentimentEvaluationSummary(TextAuthoringProjectKind.CustomTextSentiment, evaluationOptions, serializedAdditionalRawData: null, customTextSentimentEvaluation); } /// Initializes a new instance of . @@ -993,8 +737,9 @@ public static TextSentimentEvaluationSummary TextSentimentEvaluationSummary(Span /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. /// A new instance for mocking. - public static SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary sentiments = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + public static SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(IReadOnlyDictionary confusionMatrix = null, IReadOnlyDictionary sentiments = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) { + confusionMatrix ??= new Dictionary(); sentiments ??= new Dictionary(); return new SpanSentimentEvaluationSummary( @@ -1031,112 +776,311 @@ public static SentimentEvaluationSummary SentimentEvaluationSummary(double f1 = serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The resource ID. - /// The resource region. - /// A new instance for mocking. - public static AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringDeploymentOperationState TextAuthoringDeploymentOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringDeploymentOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static AssignDeploymentResourcesJobState AssignDeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static TextAuthoringDeploymentDeleteFromResourcesOperationState TextAuthoringDeploymentDeleteFromResourcesOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new AssignDeploymentResourcesJobState( + return new TextAuthoringDeploymentDeleteFromResourcesOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The job ID. - /// The creation date time of the job. - /// The last date time the job was updated. - /// The expiration date time of the job. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. /// The job status. /// The warnings that were encountered while executing the job. /// The errors encountered while executing the job. - /// A new instance for mocking. - public static UnassignDeploymentResourcesJobState UnassignDeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + /// A new instance for mocking. + public static TextAuthoringSwapDeploymentsOperationState TextAuthoringSwapDeploymentsOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - warnings ??= new List(); - errors ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new UnassignDeploymentResourcesJobState( + return new TextAuthoringSwapDeploymentsOperationState( jobId, - createdDateTime, - lastUpdatedDateTime, - expirationDateTime, + createdOn, + lastUpdatedOn, + expiresOn, status, warnings?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the project name. - /// Represents the resource region. - /// A new instance for mocking. - public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringAssignDeploymentResourcesOperationState TextAuthoringAssignDeploymentResourcesOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - deploymentsMetadata ??= new List(); + warnings ??= new List(); + errors ??= new List(); - return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); + return new TextAuthoringAssignDeploymentResourcesOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the deployment name. - /// Represents deployment last deployed time. - /// Represents deployment expiration date in the runtime. - /// A new instance for mocking. - public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringUnassignDeploymentResourcesOperationState TextAuthoringUnassignDeploymentResourcesOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringUnassignDeploymentResourcesOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The language name. - /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. - /// A new instance for mocking. - public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// A new instance for mocking. + public static TextAuthoringCreateDeploymentDetails TextAuthoringCreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) { - return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); + assignedResourceIds ??= new List(); + + return new TextAuthoringCreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The prebuilt entity category. - /// The description. - /// English examples for the entity. - /// A new instance for mocking. - public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringImportProjectOperationState TextAuthoringImportProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringImportProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Represents the version of the config. - /// Represents the training config version expiration date. - /// A new instance for mocking. - public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpirationDate = default) + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// A new instance for mocking. + public static TextAuthoringExportProjectOperationState TextAuthoringExportProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringExportProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + resultUrl, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static TextAuthoringCreateProjectDetails TextAuthoringCreateProjectDetails(TextAuthoringProjectKind projectKind = default, string storageInputContainerName = null, TextAuthoringProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new TextAuthoringCreateProjectDetails( + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringProjectDeletionOperationState TextAuthoringProjectDeletionOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) { - return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpirationDate, serializedAdditionalRawData: null); + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringProjectDeletionOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static TextAuthoringCopyProjectOperationState TextAuthoringCopyProjectOperationState(string jobId = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, DateTimeOffset? expiresOn = null, TextAuthoringOperationStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new TextAuthoringCopyProjectOperationState( + jobId, + createdOn, + lastUpdatedOn, + expiresOn, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// A new instance for mocking. + public static TextAuthoringExportedProject TextAuthoringExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, TextAuthoringCreateProjectDetails metadata = null, TextAuthoringExportedProjectAsset assets = null) + { + return new TextAuthoringExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the summary file location in the blob store container associated with the project. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) + { + return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// Represents the settings for using data generation as part of training a custom model. + /// A new instance for mocking. + public static TextAuthoringTrainingJobDetails TextAuthoringTrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, TextAuthoringEvaluationDetails evaluationOptions = null, DataGenerationSetting dataGenerationSettings = null) + { + return new TextAuthoringTrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// A new instance for mocking. + public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) + { + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModels.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModels.cs new file mode 100644 index 000000000000..3fe0d05b99c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModels.cs @@ -0,0 +1,1777 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Text.Authoring +{ + // Data plane generated sub-client. + /// The TextAuthoringModels sub-client. + public partial class TextAuthoringModels + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 TextAuthoringModels for mocking. + protected TextAuthoringModels() + { + } + + /// Initializes a new instance of TextAuthoringModels. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal TextAuthoringModels(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringExportedTrainedModel.FromResponse(response), response); + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModel(projectName, exportedModelName, context); + return Response.FromValue(TextAuthoringExportedTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportedModel(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringExportedModelOperationState.FromResponse(response), response); + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); + return Response.FromValue(TextAuthoringExportedModelOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelManifestAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelManifest(projectName, exportedModelName, context); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportedModelManifestAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringProjectTrainedModel.FromResponse(response), response); + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainedModel(projectName, trainedModelLabel, context); + return Response.FromValue(TextAuthoringProjectTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringEvaluationOperationState.FromResponse(response), response); + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(TextAuthoringEvaluationOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringEvaluationSummary.FromResponse(response), response); + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); + return Response.FromValue(TextAuthoringEvaluationSummary.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringLoadSnapshotOperationState.FromResponse(response), response); + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(TextAuthoringLoadSnapshotOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TextAuthoringDocumentEvaluationResult.DeserializeTextAuthoringDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TextAuthoringDocumentEvaluationResult.DeserializeTextAuthoringDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAuthoringModels.GetModelEvaluationResults", "value", "nextLink", maxpagesize, context); + } + + /// Creates a new exported model or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, TextAuthoringExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); + } + + /// Creates a new exported model or replaces an existing one. + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, TextAuthoringExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers evaluation operation on a trained model. + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, TextAuthoringEvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringEvaluationJobResultFromTextAuthoringEvaluationOperationState, ClientDiagnostics, "TextAuthoringModels.EvaluateModel"); + } + + /// Triggers evaluation operation on a trained model. + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, TextAuthoringEvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringEvaluationJobResultFromTextAuthoringEvaluationOperationState, ClientDiagnostics, "TextAuthoringModels.EvaluateModel"); + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringModels.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringModels.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelManifestRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/manifest", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:evaluate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:load-snapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluate/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/result", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/summary-result", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/load-snapshot/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + + private TextAuthoringEvaluationJobResult FetchTextAuthoringEvaluationJobResultFromTextAuthoringEvaluationOperationState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TextAuthoringEvaluationJobResult.DeserializeTextAuthoringEvaluationJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjects.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjects.cs new file mode 100644 index 000000000000..67f6ad323c7f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringProjects.cs @@ -0,0 +1,1876 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Text.Authoring +{ + // Data plane generated sub-client. + /// The TextAuthoringProjects sub-client. + public partial class TextAuthoringProjects + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + 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 TextAuthoringProjects for mocking. + protected TextAuthoringProjects() + { + } + + /// Initializes a new instance of TextAuthoringProjects. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal TextAuthoringProjects(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringImportProjectOperationState.FromResponse(response), response); + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImportStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringImportProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, 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 new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringExportProjectOperationState.FromResponse(response), response); + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringExportProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringProjectMetadata.FromResponse(response), response); + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProject(projectName, context); + return Response.FromValue(TextAuthoringProjectMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetProjectAsync(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetProject(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> AuthorizeProjectCopyAsync(string projectName, TextAuthoringProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AuthorizeProjectCopyAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringCopyProjectDetails.FromResponse(response), response); + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response AuthorizeProjectCopy(string projectName, TextAuthoringProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AuthorizeProjectCopy(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); + return Response.FromValue(TextAuthoringCopyProjectDetails.FromResponse(response), response); + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task AuthorizeProjectCopyAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.AuthorizeProjectCopy"); + scope.Start(); + try + { + using HttpMessage message = CreateAuthorizeProjectCopyRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response AuthorizeProjectCopy(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.AuthorizeProjectCopy"); + scope.Start(); + try + { + using HttpMessage message = CreateAuthorizeProjectCopyRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringCopyProjectOperationState.FromResponse(response), response); + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCopyProjectStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringCopyProjectOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetCopyProjectStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringTrainingOperationState.FromResponse(response), response); + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingStatus(projectName, jobId, context); + return Response.FromValue(TextAuthoringTrainingOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetTrainingStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); + return Response.FromValue(TextAuthoringProjectDeletionOperationState.FromResponse(response), response); + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProjectDeletionStatus(jobId, context); + return Response.FromValue(TextAuthoringProjectDeletionOperationState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetProjectDeletionStatusAsync(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual Response GetProjectDeletionStatus(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Copies an existing project to another Azure resource. + /// 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. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, TextAuthoringCopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Copies an existing project to another Azure resource. + /// 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. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, TextAuthoringCopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CopyProject(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to export a project's data. + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); + } + + /// Triggers a job to export a project's data. + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context); + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Export(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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. + /// The name of the project to use. + /// The project data to import. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, TextAuthoringExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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. + /// The name of the project to use. + /// The project data to import. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Import(WaitUntil waitUntil, string projectName, TextAuthoringExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return Import(waitUntil, projectName, content, format, context); + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a training job for a project. + /// 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. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TextAuthoringTrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringTrainingJobResultFromTextAuthoringTrainingOperationState, ClientDiagnostics, "TextAuthoringProjects.Train"); + } + + /// Triggers a training job for a project. + /// 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. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation Train(WaitUntil waitUntil, string projectName, TextAuthoringTrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Train(waitUntil, projectName, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringTrainingJobResultFromTextAuthoringTrainingOperationState, ClientDiagnostics, "TextAuthoringProjects.Train"); + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// 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 of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a cancellation for a running training 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. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringTrainingJobResultFromTextAuthoringTrainingOperationState, ClientDiagnostics, "TextAuthoringProjects.CancelTrainingJob"); + } + + /// Triggers a cancellation for a running training 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. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); + return ProtocolOperationHelpers.Convert(response, FetchTextAuthoringTrainingJobResultFromTextAuthoringTrainingOperationState, ClientDiagnostics, "TextAuthoringProjects.CancelTrainingJob"); + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// 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. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAuthoringProjects.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAuthoringProjects.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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"); + return message; + } + + internal HttpMessage CreateGetProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/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/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAuthorizeProjectCopyRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:authorize-copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateCopyProjectRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateExportRequest(string projectName, string stringIndexType, string assetKind, string trainedModelLabel, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + if (trainedModelLabel != null) + { + uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string format, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (format != null) + { + request.Headers.Add("format", format); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:train", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetCopyProjectStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/copy/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string 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("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/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; + } + + internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + + private TextAuthoringTrainingJobResult FetchTextAuthoringTrainingJobResultFromTextAuthoringTrainingOperationState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TextAuthoringTrainingJobResult.DeserializeTextAuthoringTrainingJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs deleted file mode 100644 index 8dec7c7ae587..000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs +++ /dev/null @@ -1,6356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Azure.AI.Language.Text.Authoring.Models; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.AI.Language.Text.Authoring.Samples -{ - public partial class Samples_TextAnalysisAuthoring - { - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProject(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }); - Response response = client.CreateProject("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }); - Response response = await client.CreateProjectAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }); - Response response = client.CreateProject("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }); - Response response = await client.CreateProjectAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - }); - Response response = client.CopyProjectAuthorization("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - }); - Response response = await client.CopyProjectAuthorizationAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - allowOverwrite = true, - }); - Response response = client.CopyProjectAuthorization("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - allowOverwrite = true, - }); - Response response = await client.CopyProjectAuthorizationAsync("", content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("targetProjectName").ToString()); - Console.WriteLine(result.GetProperty("accessToken").ToString()); - Console.WriteLine(result.GetProperty("expiresAt").ToString()); - Console.WriteLine(result.GetProperty("targetResourceId").ToString()); - Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetCopyProjectStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetCopyProjectStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeployment("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetDeploymentStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetDeploymentStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetSwapDeploymentsStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetSwapDeploymentsStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("resultUrl").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("resultUrl").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelJobStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelJobStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelManifest("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelManifestAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelManifest("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelManifestAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelManifest("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelManifestAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetExportedModelManifest("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetExportedModelManifestAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetImportStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetImportStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainedModel("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainedModelAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.DeleteTrainedModel("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.DeleteTrainedModelAsync("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.DeleteTrainedModel("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.DeleteTrainedModelAsync("", ""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetEvaluationStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetEvaluationStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetModelEvaluationSummary("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetModelEvaluationSummaryAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetLoadSnapshotStatus("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetAssignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetUnassignDeploymentResourcesStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", "", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetTrainingStatus("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetTrainingStatusAsync("", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = client.GetProjectDeletionStatus(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Response response = await client.GetProjectDeletionStatusAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetProjects(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectMetadata item in client.GetProjects()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectMetadata item in client.GetProjectsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); - Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("multilingual").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectDeployment item in client.GetDeployments("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); - Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ExportedTrainedModel item in client.GetExportedModels("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("exportedModelName").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectTrainedModel item in client.GetTrainedModels("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("label").ToString()); - Console.WriteLine(result.GetProperty("modelId").ToString()); - Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectKind").ToString()); - Console.WriteLine(result.GetProperty("location").ToString()); - Console.WriteLine(result.GetProperty("language").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("azureResourceId").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingJobState item in client.GetTrainingJobs("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); - Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("projectName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); - Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (SupportedLanguage item in client.GetSupportedLanguages()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("languageName").ToString()); - Console.WriteLine(result.GetProperty("languageCode").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("category").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("examples").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteProject(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteProject(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = client.CopyProject(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.CustomSingleLabelClassification, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = client.CopyProject(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.CustomSingleLabelClassification, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = client.CopyProject(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectKind = "CustomSingleLabelClassification", - targetProjectName = "", - accessToken = "", - expiresAt = "2022-05-10T18:57:31.2311892Z", - targetResourceId = "", - targetResourceRegion = "", - }); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.CustomSingleLabelClassification, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = client.CopyProject(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CopyProjectDetails body = new CopyProjectDetails( - ProjectKind.CustomSingleLabelClassification, - "", - "", - DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), - "", - ""); - Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Export_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Export_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Export_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Import_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }, - }); - Operation operation = client.Import(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - projectName = "", - language = "", - }, - }); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); - Operation operation = client.Import(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Import_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - documents = new object[] - { -new -{ -summaryLocation = "", -location = "", -language = "", -dataset = "", -} - }, - projectKind = "CustomAbstractiveSummarization", - }, - }); - Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - projectFileVersion = "", - stringIndexType = "Utf16CodeUnit", - metadata = new - { - projectKind = "CustomSingleLabelClassification", - storageInputContainerName = "", - settings = new - { - confidenceThreshold = 123.45F, - amlProjectPath = "", - isLabelingLocked = true, - runGptPredictions = true, - gptPredictiveLookahead = 1234, - }, - projectName = "", - multilingual = true, - description = "", - language = "", - }, - assets = new - { - documents = new object[] - { -new -{ -summaryLocation = "", -location = "", -language = "", -dataset = "", -} - }, - projectKind = "CustomAbstractiveSummarization", - }, - }); - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Import_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") - { - Settings = new ProjectSettings - { - ConfidenceThreshold = 123.45F, - AmlProjectPath = "", - IsLabelingLocked = true, - RunGptPredictions = true, - GptPredictiveLookahead = 1234, - }, - Multilingual = true, - Description = "", - }) - { - Assets = new ExportedCustomAbstractiveSummarizationProjectAssets - { - Documents = {new ExportedCustomAbstractiveSummarizationDocument("") -{ -Location = "", -Language = "", -Dataset = "", -}}, - }, - }; - Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") - { - Settings = new ProjectSettings - { - ConfidenceThreshold = 123.45F, - AmlProjectPath = "", - IsLabelingLocked = true, - RunGptPredictions = true, - GptPredictiveLookahead = 1234, - }, - Multilingual = true, - Description = "", - }) - { - Assets = new ExportedCustomAbstractiveSummarizationProjectAssets - { - Documents = {new ExportedCustomAbstractiveSummarizationDocument("") -{ -Location = "", -Language = "", -Dataset = "", -}}, - }, - }; - Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Train_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - }); - Operation operation = client.Train(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - }); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", ""); - Operation operation = client.Train(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", ""); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Train_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - dataGenerationSettings = new - { - enableDataGeneration = true, - dataGenerationConnectionInfo = new - { - kind = "azureOpenAI", - resourceId = "", - deploymentName = "", - }, - }, - }); - Operation operation = client.Train(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - modelLabel = "", - trainingConfigVersion = "", - evaluationOptions = new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }, - dataGenerationSettings = new - { - enableDataGeneration = true, - dataGenerationConnectionInfo = new - { - kind = "azureOpenAI", - resourceId = "", - deploymentName = "", - }, - }, - }); - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_Train_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", "") - { - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), - }; - Operation operation = client.Train(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - TrainingJobDetails body = new TrainingJobDetails("", "") - { - EvaluationOptions = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }, - DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), - }; - Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails(""); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails(""); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeployProject_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails("") - { - AssignedResourceIds = { "" }, - }; - Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - CreateDeploymentDetails body = new CreateDeploymentDetails("") - { - AssignedResourceIds = { "" }, - }; - Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails(); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails(); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails - { - AssignedResourceIds = { "" }, - }; - Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - DeleteDeploymentDetails body = new DeleteDeploymentDetails - { - AssignedResourceIds = { "" }, - }; - Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - firstDeploymentName = "", - secondDeploymentName = "", - }); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); - Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - trainedModelLabel = "", - }); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - ExportedModelDetails body = new ExportedModelDetails(""); - Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new object()); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails(); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails(); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }); - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - kind = "percentage", - trainingSplitPercentage = 1234, - testingSplitPercentage = 1234, - }); - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("percentComplete").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }; - Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - EvaluationDetails body = new EvaluationDetails - { - Kind = EvaluationKind.Percentage, - TrainingSplitPercentage = 1234, - TestingSplitPercentage = 1234, - }; - Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); - EvaluationJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - resourcesMetadata = new object[] - { -new -{ -azureResourceId = "", -customDomain = "", -region = "", -} - }, - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] - { -new ResourceMetadata("", "", "") - }); - Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - using RequestContent content = RequestContent.Create(new - { - assignedResourceIds = new object[] - { -"" - }, - }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); - Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); - BinaryData responseData = operation.Value; - - JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("modelLabel").ToString()); - Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); - Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); - - Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); - TrainingJobResult responseData = operation.Value; - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml index 1c0e1d21fd59..eb8f4926445d 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cognitiveservices/Language.AnalyzeText-authoring -commit: 1bbb8f628f6e3083b73a2190e15bb0f5911571a3 +commit: 0f6d127b3922dfa2f75e48cf9f77d70b717bb434 repo: Azure/azure-rest-api-specs - +additionalDirectories: