diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index df67afa0183f..e9711d013921 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -263,6 +263,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.20.0;5.21.0- com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.20.0;5.21.0-beta.1 com.azure.spring:spring-cloud-azure-testcontainers;5.20.0;5.21.0-beta.1 com.azure:azure-spring-data-cosmos;5.20.0;5.21.0-beta.1 +com.azure:azure-ai-language-text-authoring;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager;2.47.0;2.48.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.47.0;2.48.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.47.0;2.48.0-beta.1 diff --git a/pom.xml b/pom.xml index f5498ce9b286..b9c14d26a317 100644 --- a/pom.xml +++ b/pom.xml @@ -40,6 +40,7 @@ sdk/changeanalysis sdk/chaos sdk/clientcore + sdk/cognitivelanguage sdk/cognitiveservices sdk/commerce sdk/communication diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-text-authoring/CHANGELOG.md new file mode 100644 index 000000000000..6998ebcaabbe --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/CHANGELOG.md @@ -0,0 +1,16 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure Authoring client library for Java. This package contains Microsoft Azure Authoring client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes +### Features Added + +- Initial release for the azure-ai-language-text-authoring Java SDK. diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/README.md b/sdk/cognitivelanguage/azure-ai-language-text-authoring/README.md new file mode 100644 index 000000000000..0498b96fc6a1 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/README.md @@ -0,0 +1,78 @@ +# Azure Authoring client library for Java + +Azure Authoring client library for Java. + +This package contains Microsoft Azure Authoring client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-ai-language-text-authoring;current}) +```xml + + com.azure + azure-ai-language-text-authoring + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.ai.language.text.authoring.readme +``` + +### Service API versions + +The client library targets the latest service API version by default. +The service client builder accepts an optional service API version parameter to specify which API version to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. +This ensures that the client can communicate with services using the specified API version. + +When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version. +If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/assets.json b/sdk/cognitivelanguage/azure-ai-language-text-authoring/assets.json new file mode 100644 index 000000000000..2dc184e49c55 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/assets.json @@ -0,0 +1 @@ +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/cognitivelanguage/azure-ai-language-text-authoring","Tag":""} \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/pom.xml b/sdk/cognitivelanguage/azure-ai-language-text-authoring/pom.xml new file mode 100644 index 000000000000..5acb378c5a2a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-ai-language-text-authoring + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Authoring + This package contains Microsoft Azure Authoring client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + false + + + + com.azure + azure-core + 1.55.1 + + + com.azure + azure-core-http-netty + 1.15.9 + + + com.azure + azure-core-test + 1.27.0-beta.6 + test + + + com.azure + azure-identity + 1.15.2 + test + + + diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringAsyncClient.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringAsyncClient.java new file mode 100644 index 000000000000..a98ec66672b3 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringAsyncClient.java @@ -0,0 +1,3981 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring; + +import com.azure.ai.language.text.authoring.implementation.JsonMergePatchHelper; +import com.azure.ai.language.text.authoring.implementation.TextAnalysisAuthoringsImpl; +import com.azure.ai.language.text.authoring.implementation.models.CopyProjectAuthorizationRequest; +import com.azure.ai.language.text.authoring.models.ExportedProject; +import com.azure.ai.language.text.authoring.models.ProjectKind; +import com.azure.ai.language.text.authoring.models.StringIndexType; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedDeploymentResource; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedProjectDeploymentsMetadata; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateDeploymentOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateProjectOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeleteDeploymentOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEvaluationResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationSummary; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelManifest; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedTrainedModel; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringImportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringLoadSnapshotJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringPrebuiltEntity; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeletionJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeployment; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectMetadata; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectTrainedModel; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSupportedLanguage; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingConfigVersion; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesOptions; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AuthoringClient type. + */ +@ServiceClient(builder = AuthoringClientBuilder.class, isAsync = true) +public final class AuthoringAsyncClient { + @Generated + private final TextAnalysisAuthoringsImpl serviceClient; + + /** + * Initializes an instance of AuthoringAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AuthoringAsyncClient(TextAnalysisAuthoringsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProjects(RequestOptions requestOptions) { + return this.serviceClient.listProjectsAsync(requestOptions); + } + + /** + * Gets the details of a project. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a project along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getProjectWithResponse(String projectName, RequestOptions requestOptions) { + return this.serviceClient.getProjectWithResponseAsync(projectName, requestOptions); + } + + /** + * The most basic operation that applies to a resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *     storageInputContainerName: String (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Optional, Required on create)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Optional, Required on create)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param body The request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the metadata of a project along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createProjectWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createProjectWithResponseAsync(projectName, body, requestOptions); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteProject(String projectName, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteProjectAsync(projectName, requestOptions); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param copyProjectAuthorizationRequest The copyProjectAuthorizationRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the options for copying an existing project to another Azure resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> copyProjectAuthorizationWithResponse(String projectName, + BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions) { + return this.serviceClient.copyProjectAuthorizationWithResponseAsync(projectName, + copyProjectAuthorizationRequest, requestOptions); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCopyProject(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginCopyProjectAsync(projectName, body, requestOptions); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginExport(String projectName, String stringIndexType, + RequestOptions requestOptions) { + return this.serviceClient.beginExportAsync(projectName, stringIndexType, requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportMethod(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginImportMethodAsync(projectName, body, requestOptions); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrain(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainAsync(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing copy project job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing copy project job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCopyProjectStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getCopyProjectStatusWithResponseAsync(projectName, jobId, requestOptions); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeployments(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listDeploymentsAsync(projectName, requestOptions); + } + + /** + * Gets the details of a deployment. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentWithResponse(String projectName, String deploymentName, + RequestOptions requestOptions) { + return this.serviceClient.getDeploymentWithResponseAsync(projectName, deploymentName, requestOptions); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeployProject(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginDeployProjectAsync(projectName, deploymentName, body, requestOptions); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDeployment(String projectName, String deploymentName, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDeploymentAsync(projectName, deploymentName, requestOptions); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDeploymentFromResources(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDeploymentFromResourcesAsync(projectName, deploymentName, body, + requestOptions); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing delete deployment from specific resources job along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentDeleteFromResourcesStatusWithResponse(String projectName, + String deploymentName, String jobId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentDeleteFromResourcesStatusWithResponseAsync(projectName, deploymentName, + jobId, requestOptions); + } + + /** + * Gets the status of an existing deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing deployment job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentStatusWithResponse(String projectName, String deploymentName, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentStatusWithResponseAsync(projectName, deploymentName, jobId, + requestOptions); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginSwapDeployments(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginSwapDeploymentsAsync(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing swap deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing swap deployment job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSwapDeploymentsStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getSwapDeploymentsStatusWithResponseAsync(projectName, jobId, requestOptions); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     resultUrl: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an export job along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getExportStatusWithResponseAsync(projectName, jobId, requestOptions); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listExportedModels(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listExportedModelsAsync(projectName, requestOptions); + } + + /** + * Gets the details of an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of an exported model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.getExportedModelWithResponseAsync(projectName, exportedModelName, requestOptions); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrUpdateExportedModel(String projectName, + String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrUpdateExportedModelAsync(projectName, exportedModelName, body, + requestOptions); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteExportedModel(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteExportedModelAsync(projectName, exportedModelName, requestOptions); + } + + /** + * Gets the status for an existing job to create or update an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an existing job to create or update an exported model along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelJobStatusWithResponse(String projectName, + String exportedModelName, String jobId, RequestOptions requestOptions) { + return this.serviceClient.getExportedModelJobStatusWithResponseAsync(projectName, exportedModelName, jobId, + requestOptions); + } + + /** + * Gets the details and URL needed to download the exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelFiles (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             contentUri: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details and URL needed to download the exported model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelManifestWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.getExportedModelManifestWithResponseAsync(projectName, exportedModelName, + requestOptions); + } + + /** + * Gets the status for an import. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an import along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getImportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getImportStatusWithResponseAsync(projectName, jobId, requestOptions); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainedModels(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listTrainedModelsAsync(projectName, requestOptions); + } + + /** + * Gets the details of a trained model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a trained model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.getTrainedModelWithResponseAsync(projectName, trainedModelLabel, requestOptions); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.deleteTrainedModelWithResponseAsync(projectName, trainedModelLabel, requestOptions); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginEvaluateModel(String projectName, String trainedModelLabel, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginEvaluateModelAsync(projectName, trainedModelLabel, body, requestOptions); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginLoadSnapshot(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.beginLoadSnapshotAsync(projectName, trainedModelLabel, requestOptions); + } + + /** + * Gets the status for an evaluation job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         evaluationOptions (Required): {
+     *             kind: String(percentage/manual) (Optional)
+     *             trainingSplitPercentage: Integer (Optional)
+     *             testingSplitPercentage: Integer (Optional)
+     *         }
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         percentComplete: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an evaluation job along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getEvaluationStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getEvaluationStatusWithResponseAsync(projectName, trainedModelLabel, jobId, + requestOptions); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getModelEvaluationResults(String projectName, String trainedModelLabel, + String stringIndexType, RequestOptions requestOptions) { + return this.serviceClient.getModelEvaluationResultsAsync(projectName, trainedModelLabel, stringIndexType, + requestOptions); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     evaluationOptions (Required): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the evaluation summary of a trained model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelEvaluationSummaryWithResponse(String projectName, + String trainedModelLabel, RequestOptions requestOptions) { + return this.serviceClient.getModelEvaluationSummaryWithResponseAsync(projectName, trainedModelLabel, + requestOptions); + } + + /** + * Gets the status for loading a snapshot. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for loading a snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadSnapshotStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getLoadSnapshotStatusWithResponseAsync(projectName, trainedModelLabel, jobId, + requestOptions); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentResources(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listDeploymentResourcesAsync(projectName, requestOptions); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAssignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginAssignDeploymentResourcesAsync(projectName, body, requestOptions); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUnassignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginUnassignDeploymentResourcesAsync(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing assign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing assign deployment resources job along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getAssignDeploymentResourcesStatusWithResponseAsync(projectName, jobId, + requestOptions); + } + + /** + * Gets the status of an existing unassign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing unassign deployment resources job along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUnassignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getUnassignDeploymentResourcesStatusWithResponseAsync(projectName, jobId, + requestOptions); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingJobs(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listTrainingJobsAsync(projectName, requestOptions); + } + + /** + * Gets the status for a training job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a training job along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainingStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponseAsync(projectName, jobId, requestOptions); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCancelTrainingJob(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.beginCancelTrainingJobAsync(projectName, jobId, requestOptions); + } + + /** + * Gets the status for a project deletion job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a project deletion job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getProjectDeletionStatusWithResponse(String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getProjectDeletionStatusWithResponseAsync(jobId, requestOptions); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssignedResourceDeployments(RequestOptions requestOptions) { + return this.serviceClient.listAssignedResourceDeploymentsAsync(requestOptions); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedLanguages(RequestOptions requestOptions) { + return this.serviceClient.getSupportedLanguagesAsync(requestOptions); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedPrebuiltEntities(RequestOptions requestOptions) { + return this.serviceClient.getSupportedPrebuiltEntitiesAsync(requestOptions); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingConfigVersions(RequestOptions requestOptions) { + return this.serviceClient.listTrainingConfigVersionsAsync(requestOptions); + } + + /** + * Lists the existing projects. + * + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProjects(Integer top, Integer skip) { + // Generated convenience method for listProjects + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listProjects(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectMetadata.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the existing projects. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProjects() { + // Generated convenience method for listProjects + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listProjects(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectMetadata.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the details of a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a project on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getProject(String projectName) { + // Generated convenience method for getProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectWithResponse(projectName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectMetadata.class)); + } + + /** + * The most basic operation that applies to a resource. + * + * @param projectName The new project name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the metadata of a project on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createProject(String projectName, + TextAnalysisAuthoringCreateProjectOptions body) { + // Generated convenience method for createProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTextAnalysisAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTextAnalysisAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, false); + return createProjectWithResponse(projectName, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectMetadata.class)); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteProject(String projectName) { + // Generated convenience method for beginDeleteProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteProjectWithModelAsync(projectName, requestOptions); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + * + * @param projectName The new project name. + * @param projectKind Represents the project kind. + * @param storageInputContainerName The name of the storage container. + * @param allowOverwrite Whether to allow an existing project to be overwritten using the resulting copy + * authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the options for copying an existing project to another Azure resource on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono copyProjectAuthorization(String projectName, + ProjectKind projectKind, String storageInputContainerName, Boolean allowOverwrite) { + // Generated convenience method for copyProjectAuthorizationWithResponse + RequestOptions requestOptions = new RequestOptions(); + CopyProjectAuthorizationRequest copyProjectAuthorizationRequestObj + = new CopyProjectAuthorizationRequest(projectKind).setStorageInputContainerName(storageInputContainerName) + .setAllowOverwrite(allowOverwrite); + BinaryData copyProjectAuthorizationRequest = BinaryData.fromObject(copyProjectAuthorizationRequestObj); + return copyProjectAuthorizationWithResponse(projectName, copyProjectAuthorizationRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringCopyProjectOptions.class)); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + * + * @param projectName The new project name. + * @param projectKind Represents the project kind. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the options for copying an existing project to another Azure resource on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono copyProjectAuthorization(String projectName, + ProjectKind projectKind) { + // Generated convenience method for copyProjectAuthorizationWithResponse + RequestOptions requestOptions = new RequestOptions(); + CopyProjectAuthorizationRequest copyProjectAuthorizationRequestObj + = new CopyProjectAuthorizationRequest(projectKind); + BinaryData copyProjectAuthorizationRequest = BinaryData.fromObject(copyProjectAuthorizationRequestObj); + return copyProjectAuthorizationWithResponse(projectName, copyProjectAuthorizationRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringCopyProjectOptions.class)); + } + + /** + * Copies an existing project to another Azure resource. + * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCopyProject(String projectName, + TextAnalysisAuthoringCopyProjectOptions body) { + // Generated convenience method for beginCopyProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCopyProjectWithModelAsync(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a job to export a project's data. + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @param assetKind Kind of asset to export. + * @param trainedModelLabel Trained model label to export. If the trainedModelLabel is null, the default behavior is + * to export the current working copy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginExport(String projectName, + StringIndexType stringIndexType, String assetKind, String trainedModelLabel) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + if (assetKind != null) { + requestOptions.addQueryParam("assetKind", assetKind, false); + } + if (trainedModelLabel != null) { + requestOptions.addQueryParam("trainedModelLabel", trainedModelLabel, false); + } + return serviceClient.beginExportWithModelAsync(projectName, stringIndexType.toString(), requestOptions); + } + + /** + * Triggers a job to export a project's data. + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginExport(String projectName, + StringIndexType stringIndexType) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginExportWithModelAsync(projectName, stringIndexType.toString(), requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param format 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportMethod(String projectName, + ExportedProject body, String format) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + if (format != null) { + requestOptions.setHeader(HttpHeaderName.fromString("format"), format); + } + return serviceClient.beginImportMethodWithModelAsync(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportMethod(String projectName, + ExportedProject body) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportMethodWithModelAsync(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a training job for a project. + * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginTrain(String projectName, TextAnalysisAuthoringTrainingJobOptions body) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModelAsync(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Gets the status of an existing copy project job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing copy project job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCopyProjectStatus(String projectName, String jobId) { + // Generated convenience method for getCopyProjectStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCopyProjectStatusWithResponse(projectName, jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringCopyProjectJobState.class)); + } + + /** + * Lists the deployments belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeployments(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listDeployments + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listDeployments(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map( + protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectDeployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the deployments belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeployments(String projectName) { + // Generated convenience method for listDeployments + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDeployments(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map( + protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectDeployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the details of a deployment. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a deployment on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeployment(String projectName, String deploymentName) { + // Generated convenience method for getDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentWithResponse(projectName, deploymentName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectDeployment.class)); + } + + /** + * Creates a new deployment or replaces an existing one. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeployProject(String projectName, + String deploymentName, TextAnalysisAuthoringCreateDeploymentOptions body) { + // Generated convenience method for beginDeployProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeployProjectWithModelAsync(projectName, deploymentName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDeployment(String projectName, + String deploymentName) { + // Generated convenience method for beginDeleteDeploymentWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDeploymentWithModelAsync(projectName, deploymentName, requestOptions); + } + + /** + * Deletes a project deployment from the specified assigned resources. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginDeleteDeploymentFromResources(String projectName, String deploymentName, + TextAnalysisAuthoringDeleteDeploymentOptions body) { + // Generated convenience method for beginDeleteDeploymentFromResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDeploymentFromResourcesWithModelAsync(projectName, deploymentName, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing delete deployment from specific resources job on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + getDeploymentDeleteFromResourcesStatus(String projectName, String deploymentName, String jobId) { + // Generated convenience method for getDeploymentDeleteFromResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentDeleteFromResourcesStatusWithResponse(projectName, deploymentName, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.class)); + } + + /** + * Gets the status of an existing deployment job. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing deployment job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeploymentStatus(String projectName, String deploymentName, + String jobId) { + // Generated convenience method for getDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentStatusWithResponse(projectName, deploymentName, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringDeploymentJobState.class)); + } + + /** + * Swaps two existing deployments with each other. + * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginSwapDeployments(String projectName, + TextAnalysisAuthoringSwapDeploymentsOptions body) { + // Generated convenience method for beginSwapDeploymentsWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginSwapDeploymentsWithModelAsync(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Gets the status of an existing swap deployment job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing swap deployment job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSwapDeploymentsStatus(String projectName, + String jobId) { + // Generated convenience method for getSwapDeploymentsStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSwapDeploymentsStatusWithResponse(projectName, jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringSwapDeploymentsJobState.class)); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an export job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getExportStatus(String projectName, String jobId) { + // Generated convenience method for getExportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportStatusWithResponse(projectName, jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringExportProjectJobState.class)); + } + + /** + * Lists the exported models belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listExportedModels(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listExportedModels + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listExportedModels(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringExportedTrainedModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the exported models belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listExportedModels(String projectName) { + // Generated convenience method for listExportedModels + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listExportedModels(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringExportedTrainedModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the details of an exported model. + * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an exported model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getExportedModel(String projectName, + String exportedModelName) { + // Generated convenience method for getExportedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelWithResponse(projectName, exportedModelName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringExportedTrainedModel.class)); + } + + /** + * Creates a new exported model or replaces an existing one. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrUpdateExportedModel( + String projectName, String exportedModelName, TextAnalysisAuthoringExportedModelOptions body) { + // Generated convenience method for beginCreateOrUpdateExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrUpdateExportedModelWithModelAsync(projectName, exportedModelName, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteExportedModel(String projectName, + String exportedModelName) { + // Generated convenience method for beginDeleteExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteExportedModelWithModelAsync(projectName, exportedModelName, requestOptions); + } + + /** + * Gets the status for an existing job to create or update an exported model. + * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an existing job to create or update an exported model on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getExportedModelJobStatus(String projectName, + String exportedModelName, String jobId) { + // Generated convenience method for getExportedModelJobStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelJobStatusWithResponse(projectName, exportedModelName, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringExportedModelJobState.class)); + } + + /** + * Gets the details and URL needed to download the exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details and URL needed to download the exported model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getExportedModelManifest(String projectName, + String exportedModelName) { + // Generated convenience method for getExportedModelManifestWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelManifestWithResponse(projectName, exportedModelName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringExportedModelManifest.class)); + } + + /** + * Gets the status for an import. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an import on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getImportStatus(String projectName, String jobId) { + // Generated convenience method for getImportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getImportStatusWithResponse(projectName, jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringImportProjectJobState.class)); + } + + /** + * Lists the trained models belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainedModels(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listTrainedModels + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listTrainedModels(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringProjectTrainedModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the trained models belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainedModels(String projectName) { + // Generated convenience method for listTrainedModels + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTrainedModels(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringProjectTrainedModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the details of a trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a trained model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTrainedModel(String projectName, + String trainedModelLabel) { + // Generated convenience method for getTrainedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectTrainedModel.class)); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTrainedModel(String projectName, String trainedModelLabel) { + // Generated convenience method for deleteTrainedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Triggers evaluation operation on a trained model. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginEvaluateModel(String projectName, String trainedModelLabel, TextAnalysisAuthoringEvaluationOptions body) { + // Generated convenience method for beginEvaluateModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginEvaluateModelWithModelAsync(projectName, trainedModelLabel, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginLoadSnapshot(String projectName, + String trainedModelLabel) { + // Generated convenience method for beginLoadSnapshotWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginLoadSnapshotWithModelAsync(projectName, trainedModelLabel, requestOptions); + } + + /** + * Gets the status for an evaluation job. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an evaluation job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getEvaluationStatus(String projectName, + String trainedModelLabel, String jobId) { + // Generated convenience method for getEvaluationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEvaluationStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringEvaluationJobState.class)); + } + + /** + * 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. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed results of the evaluation for a trained model as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getModelEvaluationResults(String projectName, + String trainedModelLabel, StringIndexType stringIndexType, Integer top, Integer skip) { + // Generated convenience method for getModelEvaluationResults + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse + = getModelEvaluationResults(projectName, trainedModelLabel, stringIndexType.toString(), requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringDocumentEvaluationResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed results of the evaluation for a trained model as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getModelEvaluationResults(String projectName, + String trainedModelLabel, StringIndexType stringIndexType) { + // Generated convenience method for getModelEvaluationResults + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = getModelEvaluationResults(projectName, trainedModelLabel, stringIndexType.toString(), requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringDocumentEvaluationResult.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the evaluation summary of a trained model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getModelEvaluationSummary(String projectName, + String trainedModelLabel) { + // Generated convenience method for getModelEvaluationSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelEvaluationSummaryWithResponse(projectName, trainedModelLabel, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringEvaluationSummary.class)); + } + + /** + * Gets the status for loading a snapshot. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for loading a snapshot on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLoadSnapshotStatus(String projectName, + String trainedModelLabel, String jobId) { + // Generated convenience method for getLoadSnapshotStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLoadSnapshotStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringLoadSnapshotJobState.class)); + } + + /** + * Lists the deployments resources assigned to the project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentResources(String projectName, + Integer top, Integer skip) { + // Generated convenience method for listDeploymentResources + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listDeploymentResources(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringAssignedDeploymentResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the deployments resources assigned to the project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentResources(String projectName) { + // Generated convenience method for listDeploymentResources + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDeploymentResources(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringAssignedDeploymentResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginAssignDeploymentResources(String projectName, TextAnalysisAuthoringAssignDeploymentResourcesOptions body) { + // Generated convenience method for beginAssignDeploymentResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginAssignDeploymentResourcesWithModelAsync(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUnassignDeploymentResources( + String projectName, TextAnalysisAuthoringUnassignDeploymentResourcesOptions body) { + // Generated convenience method for beginUnassignDeploymentResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginUnassignDeploymentResourcesWithModelAsync(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Gets the status of an existing assign deployment resources job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing assign deployment resources job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + getAssignDeploymentResourcesStatus(String projectName, String jobId) { + // Generated convenience method for getAssignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringAssignDeploymentResourcesJobState.class)); + } + + /** + * Gets the status of an existing unassign deployment resources job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing unassign deployment resources job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + getUnassignDeploymentResourcesStatus(String projectName, String jobId) { + // Generated convenience method for getUnassignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUnassignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringUnassignDeploymentResourcesJobState.class)); + } + + /** + * Lists the non-expired training jobs created for a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingJobs(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listTrainingJobs + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listTrainingJobs(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringTrainingJobState.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the non-expired training jobs created for a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingJobs(String projectName) { + // Generated convenience method for listTrainingJobs + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTrainingJobs(projectName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringTrainingJobState.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the status for a training job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for a training job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTrainingStatus(String projectName, String jobId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(projectName, jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringTrainingJobState.class)); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginCancelTrainingJob(String projectName, String jobId) { + // Generated convenience method for beginCancelTrainingJobWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCancelTrainingJobWithModelAsync(projectName, jobId, requestOptions); + } + + /** + * Gets the status for a project deletion job. + * + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for a project deletion job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getProjectDeletionStatus(String jobId) { + // Generated convenience method for getProjectDeletionStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectDeletionStatusWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringProjectDeletionJobState.class)); + } + + /** + * 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. + * + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux + listAssignedResourceDeployments(Integer top, Integer skip) { + // Generated convenience method for listAssignedResourceDeployments + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listAssignedResourceDeployments(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map( + pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssignedResourceDeployments() { + // Generated convenience method for listAssignedResourceDeployments + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listAssignedResourceDeployments(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map( + pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the supported languages. + * + * @param projectKind The project kind, default value is CustomSingleLabelClassification. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedLanguages(ProjectKind projectKind, Integer top, + Integer skip) { + // Generated convenience method for getSupportedLanguages + RequestOptions requestOptions = new RequestOptions(); + if (projectKind != null) { + requestOptions.addQueryParam("projectKind", projectKind.toString(), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = getSupportedLanguages(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map( + protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringSupportedLanguage.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the supported languages. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedLanguages() { + // Generated convenience method for getSupportedLanguages + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = getSupportedLanguages(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map( + protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringSupportedLanguage.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedPrebuiltEntities() { + // Generated convenience method for getSupportedPrebuiltEntities + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = getSupportedPrebuiltEntities(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TextAnalysisAuthoringPrebuiltEntity.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind The project kind, default value is CustomSingleLabelClassification. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingConfigVersions(ProjectKind projectKind, + Integer top, Integer skip) { + // Generated convenience method for listTrainingConfigVersions + RequestOptions requestOptions = new RequestOptions(); + if (projectKind != null) { + requestOptions.addQueryParam("projectKind", projectKind.toString(), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + PagedFlux pagedFluxResponse = listTrainingConfigVersions(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringTrainingConfigVersion.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Lists the support training config version for a given project type. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingConfigVersions() { + // Generated convenience method for listTrainingConfigVersions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTrainingConfigVersions(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData + .toObject(TextAnalysisAuthoringTrainingConfigVersion.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClient.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClient.java new file mode 100644 index 000000000000..f7e21f94aea5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClient.java @@ -0,0 +1,3691 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring; + +import com.azure.ai.language.text.authoring.implementation.JsonMergePatchHelper; +import com.azure.ai.language.text.authoring.implementation.TextAnalysisAuthoringsImpl; +import com.azure.ai.language.text.authoring.implementation.models.CopyProjectAuthorizationRequest; +import com.azure.ai.language.text.authoring.models.ExportedProject; +import com.azure.ai.language.text.authoring.models.ProjectKind; +import com.azure.ai.language.text.authoring.models.StringIndexType; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedDeploymentResource; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedProjectDeploymentsMetadata; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateDeploymentOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateProjectOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeleteDeploymentOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEvaluationResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationSummary; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelManifest; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedTrainedModel; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringImportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringLoadSnapshotJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringPrebuiltEntity; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeletionJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeployment; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectMetadata; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectTrainedModel; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSupportedLanguage; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingConfigVersion; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobOptions; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesOptions; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; + +/** + * Initializes a new instance of the synchronous AuthoringClient type. + */ +@ServiceClient(builder = AuthoringClientBuilder.class) +public final class AuthoringClient { + @Generated + private final TextAnalysisAuthoringsImpl serviceClient; + + /** + * Initializes an instance of AuthoringClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AuthoringClient(TextAnalysisAuthoringsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProjects(RequestOptions requestOptions) { + return this.serviceClient.listProjects(requestOptions); + } + + /** + * Gets the details of a project. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a project along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProjectWithResponse(String projectName, RequestOptions requestOptions) { + return this.serviceClient.getProjectWithResponse(projectName, requestOptions); + } + + /** + * The most basic operation that applies to a resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *     storageInputContainerName: String (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Optional, Required on create)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Optional, Required on create)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param body The request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the metadata of a project along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createProjectWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createProjectWithResponse(projectName, body, requestOptions); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteProject(String projectName, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteProject(projectName, requestOptions); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param copyProjectAuthorizationRequest The copyProjectAuthorizationRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the options for copying an existing project to another Azure resource along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response copyProjectAuthorizationWithResponse(String projectName, + BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions) { + return this.serviceClient.copyProjectAuthorizationWithResponse(projectName, copyProjectAuthorizationRequest, + requestOptions); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCopyProject(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginCopyProject(projectName, body, requestOptions); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginExport(String projectName, String stringIndexType, + RequestOptions requestOptions) { + return this.serviceClient.beginExport(projectName, stringIndexType, requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportMethod(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginImportMethod(projectName, body, requestOptions); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginTrain(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing copy project job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing copy project job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCopyProjectStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getCopyProjectStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeployments(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listDeployments(projectName, requestOptions); + } + + /** + * Gets the details of a deployment. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a deployment along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentWithResponse(String projectName, String deploymentName, + RequestOptions requestOptions) { + return this.serviceClient.getDeploymentWithResponse(projectName, deploymentName, requestOptions); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeployProject(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginDeployProject(projectName, deploymentName, body, requestOptions); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeployment(String projectName, String deploymentName, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDeployment(projectName, deploymentName, requestOptions); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeploymentFromResources(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDeploymentFromResources(projectName, deploymentName, body, requestOptions); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing delete deployment from specific resources job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentDeleteFromResourcesStatusWithResponse(String projectName, + String deploymentName, String jobId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentDeleteFromResourcesStatusWithResponse(projectName, deploymentName, jobId, + requestOptions); + } + + /** + * Gets the status of an existing deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing deployment job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentStatusWithResponse(String projectName, String deploymentName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getDeploymentStatusWithResponse(projectName, deploymentName, jobId, requestOptions); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginSwapDeployments(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginSwapDeployments(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing swap deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing swap deployment job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSwapDeploymentsStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getSwapDeploymentsStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     resultUrl: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an export job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getExportStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listExportedModels(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listExportedModels(projectName, requestOptions); + } + + /** + * Gets the details of an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of an exported model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.getExportedModelWithResponse(projectName, exportedModelName, requestOptions); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrUpdateExportedModel(String projectName, + String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrUpdateExportedModel(projectName, exportedModelName, body, + requestOptions); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteExportedModel(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteExportedModel(projectName, exportedModelName, requestOptions); + } + + /** + * Gets the status for an existing job to create or update an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an existing job to create or update an exported model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelJobStatusWithResponse(String projectName, String exportedModelName, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getExportedModelJobStatusWithResponse(projectName, exportedModelName, jobId, + requestOptions); + } + + /** + * Gets the details and URL needed to download the exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelFiles (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             contentUri: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details and URL needed to download the exported model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelManifestWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return this.serviceClient.getExportedModelManifestWithResponse(projectName, exportedModelName, requestOptions); + } + + /** + * Gets the status for an import. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an import along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getImportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getImportStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainedModels(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listTrainedModels(projectName, requestOptions); + } + + /** + * Gets the details of a trained model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a trained model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.getTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.deleteTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginEvaluateModel(String projectName, String trainedModelLabel, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.beginEvaluateModel(projectName, trainedModelLabel, body, requestOptions); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLoadSnapshot(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.beginLoadSnapshot(projectName, trainedModelLabel, requestOptions); + } + + /** + * Gets the status for an evaluation job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         evaluationOptions (Required): {
+     *             kind: String(percentage/manual) (Optional)
+     *             trainingSplitPercentage: Integer (Optional)
+     *             testingSplitPercentage: Integer (Optional)
+     *         }
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         percentComplete: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an evaluation job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEvaluationStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getEvaluationStatusWithResponse(projectName, trainedModelLabel, jobId, + requestOptions); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getModelEvaluationResults(String projectName, String trainedModelLabel, + String stringIndexType, RequestOptions requestOptions) { + return this.serviceClient.getModelEvaluationResults(projectName, trainedModelLabel, stringIndexType, + requestOptions); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     evaluationOptions (Required): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the evaluation summary of a trained model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelEvaluationSummaryWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return this.serviceClient.getModelEvaluationSummaryWithResponse(projectName, trainedModelLabel, requestOptions); + } + + /** + * Gets the status for loading a snapshot. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for loading a snapshot along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLoadSnapshotStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + return this.serviceClient.getLoadSnapshotStatusWithResponse(projectName, trainedModelLabel, jobId, + requestOptions); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentResources(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listDeploymentResources(projectName, requestOptions); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAssignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginAssignDeploymentResources(projectName, body, requestOptions); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUnassignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.beginUnassignDeploymentResources(projectName, body, requestOptions); + } + + /** + * Gets the status of an existing assign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing assign deployment resources job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getAssignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Gets the status of an existing unassign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing unassign deployment resources job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUnassignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getUnassignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingJobs(String projectName, RequestOptions requestOptions) { + return this.serviceClient.listTrainingJobs(projectName, requestOptions); + } + + /** + * Gets the status for a training job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a training job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponse(projectName, jobId, requestOptions); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCancelTrainingJob(String projectName, String jobId, + RequestOptions requestOptions) { + return this.serviceClient.beginCancelTrainingJob(projectName, jobId, requestOptions); + } + + /** + * Gets the status for a project deletion job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a project deletion job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProjectDeletionStatusWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getProjectDeletionStatusWithResponse(jobId, requestOptions); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssignedResourceDeployments(RequestOptions requestOptions) { + return this.serviceClient.listAssignedResourceDeployments(requestOptions); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedLanguages(RequestOptions requestOptions) { + return this.serviceClient.getSupportedLanguages(requestOptions); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedPrebuiltEntities(RequestOptions requestOptions) { + return this.serviceClient.getSupportedPrebuiltEntities(requestOptions); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingConfigVersions(RequestOptions requestOptions) { + return this.serviceClient.listTrainingConfigVersions(requestOptions); + } + + /** + * Lists the existing projects. + * + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProjects(Integer top, Integer skip) { + // Generated convenience method for listProjects + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listProjects(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectMetadata.class)); + } + + /** + * Lists the existing projects. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProjects() { + // Generated convenience method for listProjects + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listProjects(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectMetadata.class)); + } + + /** + * Gets the details of a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a project. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringProjectMetadata getProject(String projectName) { + // Generated convenience method for getProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectWithResponse(projectName, requestOptions).getValue() + .toObject(TextAnalysisAuthoringProjectMetadata.class); + } + + /** + * The most basic operation that applies to a resource. + * + * @param projectName The new project name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the metadata of a project. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringProjectMetadata createProject(String projectName, + TextAnalysisAuthoringCreateProjectOptions body) { + // Generated convenience method for createProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTextAnalysisAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTextAnalysisAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, false); + return createProjectWithResponse(projectName, bodyInBinaryData, requestOptions).getValue() + .toObject(TextAnalysisAuthoringProjectMetadata.class); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteProject(String projectName) { + // Generated convenience method for beginDeleteProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteProjectWithModel(projectName, requestOptions); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + * + * @param projectName The new project name. + * @param projectKind Represents the project kind. + * @param storageInputContainerName The name of the storage container. + * @param allowOverwrite Whether to allow an existing project to be overwritten using the resulting copy + * authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the options for copying an existing project to another Azure resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringCopyProjectOptions copyProjectAuthorization(String projectName, ProjectKind projectKind, + String storageInputContainerName, Boolean allowOverwrite) { + // Generated convenience method for copyProjectAuthorizationWithResponse + RequestOptions requestOptions = new RequestOptions(); + CopyProjectAuthorizationRequest copyProjectAuthorizationRequestObj + = new CopyProjectAuthorizationRequest(projectKind).setStorageInputContainerName(storageInputContainerName) + .setAllowOverwrite(allowOverwrite); + BinaryData copyProjectAuthorizationRequest = BinaryData.fromObject(copyProjectAuthorizationRequestObj); + return copyProjectAuthorizationWithResponse(projectName, copyProjectAuthorizationRequest, requestOptions) + .getValue() + .toObject(TextAnalysisAuthoringCopyProjectOptions.class); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + * + * @param projectName The new project name. + * @param projectKind Represents the project kind. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the options for copying an existing project to another Azure resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringCopyProjectOptions copyProjectAuthorization(String projectName, + ProjectKind projectKind) { + // Generated convenience method for copyProjectAuthorizationWithResponse + RequestOptions requestOptions = new RequestOptions(); + CopyProjectAuthorizationRequest copyProjectAuthorizationRequestObj + = new CopyProjectAuthorizationRequest(projectKind); + BinaryData copyProjectAuthorizationRequest = BinaryData.fromObject(copyProjectAuthorizationRequestObj); + return copyProjectAuthorizationWithResponse(projectName, copyProjectAuthorizationRequest, requestOptions) + .getValue() + .toObject(TextAnalysisAuthoringCopyProjectOptions.class); + } + + /** + * Copies an existing project to another Azure resource. + * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCopyProject(String projectName, + TextAnalysisAuthoringCopyProjectOptions body) { + // Generated convenience method for beginCopyProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCopyProjectWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a job to export a project's data. + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @param assetKind Kind of asset to export. + * @param trainedModelLabel Trained model label to export. If the trainedModelLabel is null, the default behavior is + * to export the current working copy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginExport(String projectName, + StringIndexType stringIndexType, String assetKind, String trainedModelLabel) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + if (assetKind != null) { + requestOptions.addQueryParam("assetKind", assetKind, false); + } + if (trainedModelLabel != null) { + requestOptions.addQueryParam("trainedModelLabel", trainedModelLabel, false); + } + return serviceClient.beginExportWithModel(projectName, stringIndexType.toString(), requestOptions); + } + + /** + * Triggers a job to export a project's data. + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginExport(String projectName, + StringIndexType stringIndexType) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginExportWithModel(projectName, stringIndexType.toString(), requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param format 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportMethod(String projectName, + ExportedProject body, String format) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + if (format != null) { + requestOptions.setHeader(HttpHeaderName.fromString("format"), format); + } + return serviceClient.beginImportMethodWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportMethod(String projectName, + ExportedProject body) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportMethodWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Triggers a training job for a project. + * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginTrain(String projectName, TextAnalysisAuthoringTrainingJobOptions body) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Gets the status of an existing copy project job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing copy project job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringCopyProjectJobState getCopyProjectStatus(String projectName, String jobId) { + // Generated convenience method for getCopyProjectStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCopyProjectStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringCopyProjectJobState.class); + } + + /** + * Lists the deployments belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeployments(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listDeployments + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listDeployments(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectDeployment.class)); + } + + /** + * Lists the deployments belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeployments(String projectName) { + // Generated convenience method for listDeployments + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeployments(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectDeployment.class)); + } + + /** + * Gets the details of a deployment. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a deployment. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringProjectDeployment getDeployment(String projectName, String deploymentName) { + // Generated convenience method for getDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentWithResponse(projectName, deploymentName, requestOptions).getValue() + .toObject(TextAnalysisAuthoringProjectDeployment.class); + } + + /** + * Creates a new deployment or replaces an existing one. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeployProject(String projectName, + String deploymentName, TextAnalysisAuthoringCreateDeploymentOptions body) { + // Generated convenience method for beginDeployProjectWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeployProjectWithModel(projectName, deploymentName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeployment(String projectName, + String deploymentName) { + // Generated convenience method for beginDeleteDeploymentWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDeploymentWithModel(projectName, deploymentName, requestOptions); + } + + /** + * Deletes a project deployment from the specified assigned resources. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginDeleteDeploymentFromResources(String projectName, String deploymentName, + TextAnalysisAuthoringDeleteDeploymentOptions body) { + // Generated convenience method for beginDeleteDeploymentFromResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDeploymentFromResourcesWithModel(projectName, deploymentName, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing delete deployment from specific resources job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState + getDeploymentDeleteFromResourcesStatus(String projectName, String deploymentName, String jobId) { + // Generated convenience method for getDeploymentDeleteFromResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentDeleteFromResourcesStatusWithResponse(projectName, deploymentName, jobId, requestOptions) + .getValue() + .toObject(TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.class); + } + + /** + * Gets the status of an existing deployment job. + * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing deployment job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringDeploymentJobState getDeploymentStatus(String projectName, String deploymentName, + String jobId) { + // Generated convenience method for getDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentStatusWithResponse(projectName, deploymentName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringDeploymentJobState.class); + } + + /** + * Swaps two existing deployments with each other. + * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginSwapDeployments(String projectName, + TextAnalysisAuthoringSwapDeploymentsOptions body) { + // Generated convenience method for beginSwapDeploymentsWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginSwapDeploymentsWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * Gets the status of an existing swap deployment job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing swap deployment job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringSwapDeploymentsJobState getSwapDeploymentsStatus(String projectName, String jobId) { + // Generated convenience method for getSwapDeploymentsStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSwapDeploymentsStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringSwapDeploymentsJobState.class); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an export job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringExportProjectJobState getExportStatus(String projectName, String jobId) { + // Generated convenience method for getExportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringExportProjectJobState.class); + } + + /** + * Lists the exported models belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listExportedModels(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listExportedModels + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listExportedModels(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringExportedTrainedModel.class)); + } + + /** + * Lists the exported models belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listExportedModels(String projectName) { + // Generated convenience method for listExportedModels + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listExportedModels(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringExportedTrainedModel.class)); + } + + /** + * Gets the details of an exported model. + * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an exported model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringExportedTrainedModel getExportedModel(String projectName, String exportedModelName) { + // Generated convenience method for getExportedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelWithResponse(projectName, exportedModelName, requestOptions).getValue() + .toObject(TextAnalysisAuthoringExportedTrainedModel.class); + } + + /** + * Creates a new exported model or replaces an existing one. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrUpdateExportedModel( + String projectName, String exportedModelName, TextAnalysisAuthoringExportedModelOptions body) { + // Generated convenience method for beginCreateOrUpdateExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrUpdateExportedModelWithModel(projectName, exportedModelName, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteExportedModel(String projectName, + String exportedModelName) { + // Generated convenience method for beginDeleteExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteExportedModelWithModel(projectName, exportedModelName, requestOptions); + } + + /** + * Gets the status for an existing job to create or update an exported model. + * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an existing job to create or update an exported model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringExportedModelJobState getExportedModelJobStatus(String projectName, + String exportedModelName, String jobId) { + // Generated convenience method for getExportedModelJobStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelJobStatusWithResponse(projectName, exportedModelName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringExportedModelJobState.class); + } + + /** + * Gets the details and URL needed to download the exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details and URL needed to download the exported model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringExportedModelManifest getExportedModelManifest(String projectName, + String exportedModelName) { + // Generated convenience method for getExportedModelManifestWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelManifestWithResponse(projectName, exportedModelName, requestOptions).getValue() + .toObject(TextAnalysisAuthoringExportedModelManifest.class); + } + + /** + * Gets the status for an import. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an import. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringImportProjectJobState getImportStatus(String projectName, String jobId) { + // Generated convenience method for getImportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getImportStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringImportProjectJobState.class); + } + + /** + * Lists the trained models belonging to a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainedModels(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listTrainedModels + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listTrainedModels(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectTrainedModel.class)); + } + + /** + * Lists the trained models belonging to a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainedModels(String projectName) { + // Generated convenience method for listTrainedModels + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTrainedModels(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringProjectTrainedModel.class)); + } + + /** + * Gets the details of a trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a trained model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringProjectTrainedModel getTrainedModel(String projectName, String trainedModelLabel) { + // Generated convenience method for getTrainedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions).getValue() + .toObject(TextAnalysisAuthoringProjectTrainedModel.class); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTrainedModel(String projectName, String trainedModelLabel) { + // Generated convenience method for deleteTrainedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions).getValue(); + } + + /** + * Triggers evaluation operation on a trained model. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginEvaluateModel(String projectName, String trainedModelLabel, TextAnalysisAuthoringEvaluationOptions body) { + // Generated convenience method for beginEvaluateModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginEvaluateModelWithModel(projectName, trainedModelLabel, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLoadSnapshot(String projectName, + String trainedModelLabel) { + // Generated convenience method for beginLoadSnapshotWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginLoadSnapshotWithModel(projectName, trainedModelLabel, requestOptions); + } + + /** + * Gets the status for an evaluation job. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for an evaluation job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringEvaluationJobState getEvaluationStatus(String projectName, String trainedModelLabel, + String jobId) { + // Generated convenience method for getEvaluationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEvaluationStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringEvaluationJobState.class); + } + + /** + * 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. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed results of the evaluation for a trained model as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getModelEvaluationResults(String projectName, + String trainedModelLabel, StringIndexType stringIndexType, Integer top, Integer skip) { + // Generated convenience method for getModelEvaluationResults + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient + .getModelEvaluationResults(projectName, trainedModelLabel, stringIndexType.toString(), requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringDocumentEvaluationResult.class)); + } + + /** + * 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. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed results of the evaluation for a trained model as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getModelEvaluationResults(String projectName, + String trainedModelLabel, StringIndexType stringIndexType) { + // Generated convenience method for getModelEvaluationResults + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .getModelEvaluationResults(projectName, trainedModelLabel, stringIndexType.toString(), requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringDocumentEvaluationResult.class)); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the evaluation summary of a trained model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringEvaluationSummary getModelEvaluationSummary(String projectName, + String trainedModelLabel) { + // Generated convenience method for getModelEvaluationSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelEvaluationSummaryWithResponse(projectName, trainedModelLabel, requestOptions).getValue() + .toObject(TextAnalysisAuthoringEvaluationSummary.class); + } + + /** + * Gets the status for loading a snapshot. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for loading a snapshot. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringLoadSnapshotJobState getLoadSnapshotStatus(String projectName, String trainedModelLabel, + String jobId) { + // Generated convenience method for getLoadSnapshotStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLoadSnapshotStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringLoadSnapshotJobState.class); + } + + /** + * Lists the deployments resources assigned to the project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentResources(String projectName, + Integer top, Integer skip) { + // Generated convenience method for listDeploymentResources + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listDeploymentResources(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringAssignedDeploymentResource.class)); + } + + /** + * Lists the deployments resources assigned to the project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentResources(String projectName) { + // Generated convenience method for listDeploymentResources + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeploymentResources(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringAssignedDeploymentResource.class)); + } + + /** + * 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. + * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginAssignDeploymentResources(String projectName, TextAnalysisAuthoringAssignDeploymentResourcesOptions body) { + // Generated convenience method for beginAssignDeploymentResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginAssignDeploymentResourcesWithModel(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUnassignDeploymentResources( + String projectName, TextAnalysisAuthoringUnassignDeploymentResourcesOptions body) { + // Generated convenience method for beginUnassignDeploymentResourcesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginUnassignDeploymentResourcesWithModel(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Gets the status of an existing assign deployment resources job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing assign deployment resources job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringAssignDeploymentResourcesJobState getAssignDeploymentResourcesStatus(String projectName, + String jobId) { + // Generated convenience method for getAssignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringAssignDeploymentResourcesJobState.class); + } + + /** + * Gets the status of an existing unassign deployment resources job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an existing unassign deployment resources job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringUnassignDeploymentResourcesJobState + getUnassignDeploymentResourcesStatus(String projectName, String jobId) { + // Generated convenience method for getUnassignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUnassignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringUnassignDeploymentResourcesJobState.class); + } + + /** + * Lists the non-expired training jobs created for a project. + * + * @param projectName The new project name. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingJobs(String projectName, Integer top, + Integer skip) { + // Generated convenience method for listTrainingJobs + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listTrainingJobs(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringTrainingJobState.class)); + } + + /** + * Lists the non-expired training jobs created for a project. + * + * @param projectName The new project name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingJobs(String projectName) { + // Generated convenience method for listTrainingJobs + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTrainingJobs(projectName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringTrainingJobState.class)); + } + + /** + * Gets the status for a training job. + * + * @param projectName The new project name. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for a training job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringTrainingJobState getTrainingStatus(String projectName, String jobId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringTrainingJobState.class); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginCancelTrainingJob(String projectName, String jobId) { + // Generated convenience method for beginCancelTrainingJobWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCancelTrainingJobWithModel(projectName, jobId, requestOptions); + } + + /** + * Gets the status for a project deletion job. + * + * @param jobId The job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status for a project deletion job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TextAnalysisAuthoringProjectDeletionJobState getProjectDeletionStatus(String jobId) { + // Generated convenience method for getProjectDeletionStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectDeletionStatusWithResponse(jobId, requestOptions).getValue() + .toObject(TextAnalysisAuthoringProjectDeletionJobState.class); + } + + /** + * 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. + * + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listAssignedResourceDeployments(Integer top, Integer skip) { + // Generated convenience method for listAssignedResourceDeployments + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listAssignedResourceDeployments(requestOptions) + .mapPage( + bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.class)); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssignedResourceDeployments() { + // Generated convenience method for listAssignedResourceDeployments + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listAssignedResourceDeployments(requestOptions) + .mapPage( + bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.class)); + } + + /** + * Lists the supported languages. + * + * @param projectKind The project kind, default value is CustomSingleLabelClassification. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedLanguages(ProjectKind projectKind, + Integer top, Integer skip) { + // Generated convenience method for getSupportedLanguages + RequestOptions requestOptions = new RequestOptions(); + if (projectKind != null) { + requestOptions.addQueryParam("projectKind", projectKind.toString(), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.getSupportedLanguages(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringSupportedLanguage.class)); + } + + /** + * Lists the supported languages. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedLanguages() { + // Generated convenience method for getSupportedLanguages + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.getSupportedLanguages(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringSupportedLanguage.class)); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedPrebuiltEntities() { + // Generated convenience method for getSupportedPrebuiltEntities + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.getSupportedPrebuiltEntities(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringPrebuiltEntity.class)); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind The project kind, default value is CustomSingleLabelClassification. + * @param top The number of result items to return. + * @param skip The number of result items to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingConfigVersions(ProjectKind projectKind, + Integer top, Integer skip) { + // Generated convenience method for listTrainingConfigVersions + RequestOptions requestOptions = new RequestOptions(); + if (projectKind != null) { + requestOptions.addQueryParam("projectKind", projectKind.toString(), false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + return serviceClient.listTrainingConfigVersions(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringTrainingConfigVersion.class)); + } + + /** + * Lists the support training config version for a given project type. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingConfigVersions() { + // Generated convenience method for listTrainingConfigVersions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTrainingConfigVersions(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(TextAnalysisAuthoringTrainingConfigVersion.class)); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClientBuilder.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClientBuilder.java new file mode 100644 index 000000000000..24900d64b84b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringClientBuilder.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring; + +import com.azure.ai.language.text.authoring.implementation.AuthoringClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the AuthoringClient type. + */ +@ServiceClientBuilder(serviceClients = { AuthoringClient.class, AuthoringAsyncClient.class }) +public final class AuthoringClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-ai-language-text-authoring.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the AuthoringClientBuilder. + */ + @Generated + public AuthoringClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AuthoringClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private AuthoringServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AuthoringClientBuilder. + */ + @Generated + public AuthoringClientBuilder serviceVersion(AuthoringServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the AuthoringClientBuilder. + */ + @Generated + public AuthoringClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of AuthoringClientImpl with the provided parameters. + * + * @return an instance of AuthoringClientImpl. + */ + @Generated + private AuthoringClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + AuthoringServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : AuthoringServiceVersion.getLatest(); + AuthoringClientImpl client = new AuthoringClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AuthoringAsyncClient class. + * + * @return an instance of AuthoringAsyncClient. + */ + @Generated + public AuthoringAsyncClient buildAsyncClient() { + return new AuthoringAsyncClient(buildInnerClient().getTextAnalysisAuthorings()); + } + + /** + * Builds an instance of AuthoringClient class. + * + * @return an instance of AuthoringClient. + */ + @Generated + public AuthoringClient buildClient() { + return new AuthoringClient(buildInnerClient().getTextAnalysisAuthorings()); + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthoringClientBuilder.class); +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringServiceVersion.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringServiceVersion.java new file mode 100644 index 000000000000..9565ea975ff8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/AuthoringServiceVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of AuthoringClient. + */ +public enum AuthoringServiceVersion implements ServiceVersion { + /** + * Enum value 2023-04-01. + */ + V2023_04_01("2023-04-01"), + + /** + * Enum value 2023-04-15-preview. + */ + V2023_04_15_PREVIEW("2023-04-15-preview"), + + /** + * Enum value 2024-11-15-preview. + */ + V2024_11_15_PREVIEW("2024-11-15-preview"); + + private final String version; + + AuthoringServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link AuthoringServiceVersion}. + */ + public static AuthoringServiceVersion getLatest() { + return V2024_11_15_PREVIEW; + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/AuthoringClientImpl.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/AuthoringClientImpl.java new file mode 100644 index 000000000000..6610dace5828 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/AuthoringClientImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.ai.language.text.authoring.AuthoringServiceVersion; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the AuthoringClient type. + */ +public final class AuthoringClientImpl { + /** + * Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final AuthoringServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AuthoringServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The TextAnalysisAuthoringsImpl object to access its operations. + */ + private final TextAnalysisAuthoringsImpl textAnalysisAuthorings; + + /** + * Gets the TextAnalysisAuthoringsImpl object to access its operations. + * + * @return the TextAnalysisAuthoringsImpl object. + */ + public TextAnalysisAuthoringsImpl getTextAnalysisAuthorings() { + return this.textAnalysisAuthorings; + } + + /** + * Initializes an instance of AuthoringClient client. + * + * @param endpoint Supported Cognitive Services endpoint e.g., + * https://<resource-name>.api.cognitiveservices.azure.com. + * @param serviceVersion Service version. + */ + public AuthoringClientImpl(String endpoint, AuthoringServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of AuthoringClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoint e.g., + * https://<resource-name>.api.cognitiveservices.azure.com. + * @param serviceVersion Service version. + */ + public AuthoringClientImpl(HttpPipeline httpPipeline, String endpoint, AuthoringServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of AuthoringClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoint e.g., + * https://<resource-name>.api.cognitiveservices.azure.com. + * @param serviceVersion Service version. + */ + public AuthoringClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + AuthoringServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.textAnalysisAuthorings = new TextAnalysisAuthoringsImpl(this); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/JsonMergePatchHelper.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..63e7b47fda00 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/JsonMergePatchHelper.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.ai.language.text.authoring.models.ProjectSettings; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateProjectOptions; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static ProjectSettingsAccessor projectSettingsAccessor; + + public interface ProjectSettingsAccessor { + ProjectSettings prepareModelForJsonMergePatch(ProjectSettings projectSettings, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(ProjectSettings projectSettings); + } + + public static void setProjectSettingsAccessor(ProjectSettingsAccessor accessor) { + projectSettingsAccessor = accessor; + } + + public static ProjectSettingsAccessor getProjectSettingsAccessor() { + return projectSettingsAccessor; + } + + private static TextAnalysisAuthoringCreateProjectOptionsAccessor textAnalysisAuthoringCreateProjectOptionsAccessor; + + public interface TextAnalysisAuthoringCreateProjectOptionsAccessor { + TextAnalysisAuthoringCreateProjectOptions prepareModelForJsonMergePatch( + TextAnalysisAuthoringCreateProjectOptions textAnalysisAuthoringCreateProjectOptions, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TextAnalysisAuthoringCreateProjectOptions textAnalysisAuthoringCreateProjectOptions); + } + + public static void setTextAnalysisAuthoringCreateProjectOptionsAccessor( + TextAnalysisAuthoringCreateProjectOptionsAccessor accessor) { + textAnalysisAuthoringCreateProjectOptionsAccessor = accessor; + } + + public static TextAnalysisAuthoringCreateProjectOptionsAccessor + getTextAnalysisAuthoringCreateProjectOptionsAccessor() { + return textAnalysisAuthoringCreateProjectOptionsAccessor; + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/OperationLocationPollingStrategy.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/OperationLocationPollingStrategy.java new file mode 100644 index 000000000000..f02d98ce3912 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/OperationLocationPollingStrategy.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.OperationResourcePollingStrategy; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * Implements an operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + final Mono> pollResponseMono + = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType) + .onErrorResume(exception -> { + LOGGER.info("Failed to parse initial response."); + return Mono.empty(); + }) + .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter)); + return pollResponseMono.switchIfEmpty( + Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter))); + } else { + return Mono + .error( + new AzureException(String.format( + "Operation failed or cancelled with status code %d," + + ", '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Mono getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + return Mono.error(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + return Mono.error(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + return PollingUtils + .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE) + .flatMap(value -> { + if (value.get(propertyName) != null) { + return BinaryData.fromObjectAsync(value.get(propertyName)) + .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType)); + } else { + return Mono.error(new AzureException("Cannot get final result")); + } + }) + .switchIfEmpty(Mono.error(new AzureException("Cannot get final result"))); + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/PollingUtils.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/PollingUtils.java new file mode 100644 index 000000000000..8c72e8ae0ada --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/PollingUtils.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.DateTimeException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; +import java.util.Map; +import java.util.function.Function; +import java.util.function.Supplier; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +final class PollingUtils { + + public static final TypeReference> POST_POLL_RESULT_TYPE_REFERENCE + = new TypeReference>() { + }; + + public static final HttpHeaderName OPERATION_LOCATION_HEADER = HttpHeaderName.fromString("Operation-Location"); + + public static final String HTTP_METHOD = "httpMethod"; + public static final String REQUEST_URL = "requestURL"; + public static final String POLL_RESPONSE_BODY = "pollResponseBody"; + + private static final String FORWARD_SLASH = "/"; + + public static String getAbsolutePath(String path, String endpoint, ClientLogger logger) { + try { + URI uri = new URI(path); + if (!uri.isAbsolute()) { + if (CoreUtils.isNullOrEmpty(endpoint)) { + throw logger.logExceptionAsError(new IllegalArgumentException( + "Relative path requires endpoint to be non-null and non-empty to create an absolute path.")); + } + + if (endpoint.endsWith(FORWARD_SLASH) && path.startsWith(FORWARD_SLASH)) { + return endpoint + path.substring(1); + } else if (!endpoint.endsWith(FORWARD_SLASH) && !path.startsWith(FORWARD_SLASH)) { + return endpoint + FORWARD_SLASH + path; + } else { + return endpoint + path; + } + } + } catch (URISyntaxException ex) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("'path' must be a valid URI.", ex)); + } + return path; + } + + public static T deserializeResponseSync(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + T value; + if (binaryData == null) { + value = null; + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = typeReference.getJavaClass().cast(binaryData.toReplayableBinaryData()); + } else { + value = binaryData.toObject(typeReference, serializer); + } + return value; + } + + @SuppressWarnings("unchecked") + public static Mono deserializeResponse(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + Mono value; + if (binaryData == null) { + value = Mono.empty(); + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = (Mono) binaryData.toReplayableBinaryDataAsync(); + } else { + value = binaryData.toObjectAsync(typeReference, serializer); + } + return value; + } + + private static final HttpHeaderName RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("retry-after-ms"); + private static final HttpHeaderName X_MS_RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("x-ms-retry-after-ms"); + + public static Duration getRetryAfterFromHeaders(HttpHeaders headers, Supplier nowSupplier) { + // Found 'x-ms-retry-after-ms' header, use a Duration of milliseconds based on the value. + Duration retryDelay = tryGetRetryDelay(headers, X_MS_RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'retry-after-ms' header, use a Duration of milliseconds based on the value. + retryDelay = tryGetRetryDelay(headers, RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'Retry-After' header. First, attempt to resolve it as a Duration of seconds. If that fails, then + // attempt to resolve it as an HTTP date (RFC1123). + retryDelay = tryGetRetryDelay(headers, HttpHeaderName.RETRY_AFTER, + headerValue -> tryParseLongOrDateTime(headerValue, nowSupplier)); + + // Either the retry delay will have been found or it'll be null, null indicates no retry after. + return retryDelay; + } + + private static Duration tryGetRetryDelay(HttpHeaders headers, HttpHeaderName headerName, + Function delayParser) { + String headerValue = headers.getValue(headerName); + + return CoreUtils.isNullOrEmpty(headerValue) ? null : delayParser.apply(headerValue); + } + + private static Duration tryParseLongOrDateTime(String value, Supplier nowSupplier) { + long delaySeconds; + try { + OffsetDateTime retryAfter = new DateTimeRfc1123(value).getDateTime(); + + delaySeconds = nowSupplier.get().until(retryAfter, ChronoUnit.SECONDS); + } catch (DateTimeException ex) { + delaySeconds = tryParseLong(value); + } + + return (delaySeconds >= 0) ? Duration.ofSeconds(delaySeconds) : null; + } + + private static long tryParseLong(String value) { + try { + return Long.parseLong(value); + } catch (NumberFormatException ex) { + return -1; + } + } + + private static Duration tryGetDelayMillis(String value) { + long delayMillis = tryParseLong(value); + return (delayMillis >= 0) ? Duration.ofMillis(delayMillis) : null; + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/SyncOperationLocationPollingStrategy.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/SyncOperationLocationPollingStrategy.java new file mode 100644 index 000000000000..41491559c214 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/SyncOperationLocationPollingStrategy.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncOperationResourcePollingStrategy; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.io.UncheckedIOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +// DO NOT modify this helper class + +/** + * Implements a synchronous operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class SyncOperationLocationPollingStrategy extends SyncOperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(SyncOperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public PollResponse onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + T initialResponseType = null; + try { + initialResponseType = PollingUtils.deserializeResponseSync((BinaryData) response.getValue(), serializer, + pollResponseType); + } catch (UncheckedIOException e) { + LOGGER.info("Failed to parse initial response."); + } + return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, initialResponseType, retryAfter); + } + + throw LOGGER.logExceptionAsError(new AzureException( + String.format("Operation failed or cancelled with status code %d, '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + + /** + * {@inheritDoc} + */ + public U getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + Map pollResult = PollingUtils.deserializeResponseSync(latestResponseBody, serializer, + PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE); + if (pollResult != null && pollResult.get(propertyName) != null) { + return PollingUtils.deserializeResponseSync(BinaryData.fromObject(pollResult.get(propertyName)), + serializer, resultType); + } else { + throw LOGGER.logExceptionAsError(new AzureException("Cannot get final result")); + } + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/TextAnalysisAuthoringsImpl.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/TextAnalysisAuthoringsImpl.java new file mode 100644 index 000000000000..3b363c46dd27 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/TextAnalysisAuthoringsImpl.java @@ -0,0 +1,10500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation; + +import com.azure.ai.language.text.authoring.AuthoringServiceVersion; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringImportProjectJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringLoadSnapshotJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeletionJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobResult; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobState; +import com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesJobState; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TextAnalysisAuthorings. + */ +public final class TextAnalysisAuthoringsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final TextAnalysisAuthoringsService service; + + /** + * The service client containing this operation class. + */ + private final AuthoringClientImpl client; + + /** + * Initializes an instance of TextAnalysisAuthoringsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TextAnalysisAuthoringsImpl(AuthoringClientImpl client) { + this.service = RestProxy.create(TextAnalysisAuthoringsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AuthoringServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AuthoringClientTextAnalysisAuthorings to be used by the proxy service + * to perform REST calls. + */ + @Host("{Endpoint}/language") + @ServiceInterface(name = "AuthoringClientTextA") + public interface TextAnalysisAuthoringsService { + @Get("/authoring/analyze-text/projects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProjects(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listProjectsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProject(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getProjectSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createProject(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Patch("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createProjectSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteProject(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteProjectSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:authorize-copy") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyProjectAuthorization(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions, + Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:authorize-copy") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyProjectAuthorizationSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions, + Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:copy") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyProject(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:copy") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyProjectSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:export") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> export(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @QueryParam("stringIndexType") String stringIndexType, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:export") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response exportSync(@HostParam("Endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("projectName") String projectName, @QueryParam("stringIndexType") String stringIndexType, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:import") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> importMethod(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:import") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response importMethodSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> train(@HostParam("Endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/:train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainSync(@HostParam("Endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/copy/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getCopyProjectStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/copy/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getCopyProjectStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeployments(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listDeploymentsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeployment(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeploymentSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deployProject(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Put("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deployProjectSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeployment(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDeploymentSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/:delete-from-resources") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeploymentFromResources(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/:delete-from-resources") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDeploymentFromResourcesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/delete-from-resources/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeploymentDeleteFromResourcesStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/delete-from-resources/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeploymentDeleteFromResourcesStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeploymentStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/{deploymentName}/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDeploymentStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("deploymentName") String deploymentName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/deployments/:swap") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> swapDeployments(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/deployments/:swap") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response swapDeploymentsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/swap/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSwapDeploymentsStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/deployments/swap/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSwapDeploymentsStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/export/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getExportStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/export/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getExportStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listExportedModels(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listExportedModelsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getExportedModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getExportedModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateExportedModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Put("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOrUpdateExportedModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteExportedModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteExportedModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getExportedModelJobStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getExportedModelJobStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}/manifest") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getExportedModelManifest(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/exported-models/{exportedModelName}/manifest") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getExportedModelManifestSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("exportedModelName") String exportedModelName, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/import/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getImportStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/import/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getImportStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainedModels(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainedModelsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTrainedModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getTrainedModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTrainedModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteTrainedModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/:evaluate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> evaluateModel(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/:evaluate") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response evaluateModelSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/:load-snapshot") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> loadSnapshot(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/:load-snapshot") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response loadSnapshotSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluate/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getEvaluationStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluate/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getEvaluationStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluation/result") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelEvaluationResults(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, + @QueryParam("stringIndexType") String stringIndexType, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluation/result") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelEvaluationResultsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, + @QueryParam("stringIndexType") String stringIndexType, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluation/summary-result") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelEvaluationSummary(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/evaluation/summary-result") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelEvaluationSummarySync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/load-snapshot/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLoadSnapshotStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/models/{trainedModelLabel}/load-snapshot/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLoadSnapshotStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("trainedModelLabel") String trainedModelLabel, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeploymentResources(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listDeploymentResourcesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/resources/:assign") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> assignDeploymentResources(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/resources/:assign") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response assignDeploymentResourcesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/resources/:unassign") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> unassignDeploymentResources(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/resources/:unassign") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response unassignDeploymentResourcesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources/assign/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAssignDeploymentResourcesStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources/assign/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAssignDeploymentResourcesStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources/unassign/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getUnassignDeploymentResourcesStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/resources/unassign/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getUnassignDeploymentResourcesStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/train/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainingJobs(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/train/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainingJobsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/train/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTrainingStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/{projectName}/train/jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getTrainingStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/train/jobs/{jobId}/:cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelTrainingJob(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Post("/authoring/analyze-text/projects/{projectName}/train/jobs/{jobId}/:cancel") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelTrainingJobSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("projectName") String projectName, + @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/authoring/analyze-text/projects/global/deletion-jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProjectDeletionStatus(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/deletion-jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getProjectDeletionStatusSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/deployments/resources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listAssignedResourceDeployments(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/deployments/resources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listAssignedResourceDeploymentsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/languages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSupportedLanguages(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/languages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSupportedLanguagesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/prebuilt-entities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSupportedPrebuiltEntities(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/prebuilt-entities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSupportedPrebuiltEntitiesSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/training-config-versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainingConfigVersions(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-text/projects/global/training-config-versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainingConfigVersionsSync(@HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProjectsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listProjectsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeploymentsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listDeploymentsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listExportedModelsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listExportedModelsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainedModelsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainedModelsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelEvaluationResultsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelEvaluationResultsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeploymentResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listDeploymentResourcesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainingJobsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainingJobsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listAssignedResourceDeploymentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listAssignedResourceDeploymentsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSupportedLanguagesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSupportedLanguagesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSupportedPrebuiltEntitiesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSupportedPrebuiltEntitiesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTrainingConfigVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTrainingConfigVersionsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProjectsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listProjects(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProjectsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listProjectsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listProjectsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProjectsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listProjectsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the existing projects. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProjects(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listProjectsSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listProjectsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the details of a project. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a project along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getProjectWithResponseAsync(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getProject(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)); + } + + /** + * Gets the details of a project. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProjectWithResponse(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getProjectSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, accept, requestOptions, Context.NONE); + } + + /** + * The most basic operation that applies to a resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *     storageInputContainerName: String (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Optional, Required on create)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Optional, Required on create)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param body The request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the metadata of a project along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createProjectWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.createProject(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, context)); + } + + /** + * The most basic operation that applies to a resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *     storageInputContainerName: String (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Optional, Required on create)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Optional, Required on create)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param body The request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the metadata of a project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createProjectWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return service.createProjectSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteProjectWithResponseAsync(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteProject(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteProjectWithResponse(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteProjectSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, accept, requestOptions, Context.NONE); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteProjectAsync(String projectName, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteProjectWithResponseAsync(projectName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteProject(String projectName, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteProjectWithResponse(projectName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginDeleteProjectWithModelAsync(String projectName, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteProjectWithResponseAsync(projectName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringProjectDeletionJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project. + * + * @param projectName The name of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginDeleteProjectWithModel(String projectName, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteProjectWithResponse(projectName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringProjectDeletionJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param copyProjectAuthorizationRequest The copyProjectAuthorizationRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the options for copying an existing project to another Azure resource along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> copyProjectAuthorizationWithResponseAsync(String projectName, + BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.copyProjectAuthorization(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, + copyProjectAuthorizationRequest, requestOptions, context)); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param copyProjectAuthorizationRequest The copyProjectAuthorizationRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents the options for copying an existing project to another Azure resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response copyProjectAuthorizationWithResponse(String projectName, + BinaryData copyProjectAuthorizationRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.copyProjectAuthorizationSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, + copyProjectAuthorizationRequest, requestOptions, Context.NONE); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> copyProjectWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.copyProject(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, context)); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response copyProjectWithResponse(String projectName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.copyProjectSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCopyProjectAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.copyProjectWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCopyProject(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.copyProjectWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCopyProjectWithModelAsync(String projectName, + BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.copyProjectWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringCopyProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     targetProjectName: String (Required)
+     *     accessToken: String (Required)
+     *     expiresAt: OffsetDateTime (Required)
+     *     targetResourceId: String (Required)
+     *     targetResourceRegion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The copy project info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCopyProjectWithModel(String projectName, + BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.copyProjectWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringCopyProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportWithResponseAsync(String projectName, String stringIndexType, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.export(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, stringIndexType, accept, requestOptions, context)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response exportWithResponse(String projectName, String stringIndexType, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.exportSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), projectName, + stringIndexType, accept, requestOptions, Context.NONE); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginExportAsync(String projectName, String stringIndexType, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.exportWithResponseAsync(projectName, stringIndexType, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginExport(String projectName, String stringIndexType, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.exportWithResponse(projectName, stringIndexType, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginExportWithModelAsync(String projectName, + String stringIndexType, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.exportWithResponseAsync(projectName, stringIndexType, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
assetKindStringNoKind of asset to export.
trainedModelLabelStringNoTrained model label to export. If the + * trainedModelLabel is null, the default behavior is to export the current working copy.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param projectName The name of the project to use. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginExportWithModel(String projectName, + String stringIndexType, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.exportWithResponse(projectName, stringIndexType, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> importMethodWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.importMethod(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, context)); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response importMethodWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.importMethodSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportMethodAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.importMethodWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportMethod(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.importMethodWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginImportMethodWithModelAsync(String projectName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.importMethodWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringImportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to import a project. If a project with the same name already exists, the data of that project is + * replaced. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
formatStringNoThe format of the project to import. The currently supported + * formats are json and aml formats. If not provided, the default is set to json.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Optional, Required on create)
+     *         storageInputContainerName: String (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: Double (Optional)
+     *             amlProjectPath: String (Optional)
+     *             isLabelingLocked: Boolean (Optional)
+     *             runGptPredictions: Boolean (Optional)
+     *             gptPredictiveLookahead: Integer (Optional)
+     *         }
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The project data to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportMethodWithModel(String projectName, + BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.importMethodWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringImportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.train(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, context)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainWithResponse(String projectName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.trainSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), projectName, + contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(projectName, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(projectName, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginTrainWithModelAsync(String projectName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(projectName, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobResult.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     *     dataGenerationSettings (Optional): {
+     *         enableDataGeneration: boolean (Required)
+     *         dataGenerationConnectionInfo (Required): {
+     *             kind: String (Required)
+     *             resourceId: String (Required)
+     *             deploymentName: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginTrainWithModel(String projectName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(projectName, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobResult.class)); + } + + /** + * Gets the status of an existing copy project job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing copy project job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCopyProjectStatusWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getCopyProjectStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status of an existing copy project job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing copy project job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCopyProjectStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getCopyProjectStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentsSinglePageAsync(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeployments(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsAsync(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentsSinglePageAsync(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentsSinglePage(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listDeploymentsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the deployments belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeployments(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentsSinglePage(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the details of a deployment. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentWithResponseAsync(String projectName, String deploymentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, accept, requestOptions, context)); + } + + /** + * Gets the details of a deployment. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentWithResponse(String projectName, String deploymentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, accept, requestOptions, Context.NONE); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deployProjectWithResponseAsync(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deployProject(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, contentType, accept, body, requestOptions, context)); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deployProjectWithResponse(String projectName, String deploymentName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.deployProjectSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeployProjectAsync(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deployProjectWithResponseAsync(projectName, deploymentName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeployProject(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deployProjectWithResponse(projectName, deploymentName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeployProjectWithModelAsync( + String projectName, String deploymentName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deployProjectWithResponseAsync(projectName, deploymentName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Creates a new deployment or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The new deployment info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeployProjectWithModel(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deployProjectWithResponse(projectName, deploymentName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteDeploymentWithResponseAsync(String projectName, String deploymentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deleteDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, accept, requestOptions, context)); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDeploymentWithResponse(String projectName, String deploymentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, accept, requestOptions, Context.NONE); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDeploymentAsync(String projectName, String deploymentName, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDeploymentWithResponseAsync(projectName, deploymentName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeployment(String projectName, String deploymentName, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDeploymentWithResponse(projectName, deploymentName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginDeleteDeploymentWithModelAsync(String projectName, String deploymentName, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDeploymentWithResponseAsync(projectName, deploymentName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment. + * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeploymentWithModel(String projectName, + String deploymentName, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDeploymentWithResponse(projectName, deploymentName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteDeploymentFromResourcesWithResponseAsync(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDeploymentFromResources(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, deploymentName, contentType, accept, body, + requestOptions, context)); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDeploymentFromResourcesWithResponse(String projectName, String deploymentName, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.deleteDeploymentFromResourcesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, deploymentName, contentType, accept, body, + requestOptions, Context.NONE); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDeploymentFromResourcesAsync(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDeploymentFromResourcesWithResponseAsync(projectName, deploymentName, body, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDeploymentFromResources(String projectName, + String deploymentName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDeploymentFromResourcesWithResponse(projectName, deploymentName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginDeleteDeploymentFromResourcesWithModelAsync(String projectName, String deploymentName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDeploymentFromResourcesWithResponseAsync(projectName, deploymentName, body, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes a project deployment from the specified assigned resources. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param deploymentName The name of the specific deployment of the project to use. + * @param body The options for deleting the deployment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginDeleteDeploymentFromResourcesWithModel(String projectName, String deploymentName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDeploymentFromResourcesWithResponse(projectName, deploymentName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing delete deployment from specific resources job along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentDeleteFromResourcesStatusWithResponseAsync(String projectName, + String deploymentName, String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDeploymentDeleteFromResourcesStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, deploymentName, jobId, accept, requestOptions, + context)); + } + + /** + * Gets the status of an existing delete deployment from specific resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing delete deployment from specific resources job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentDeleteFromResourcesStatusWithResponse(String projectName, + String deploymentName, String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDeploymentDeleteFromResourcesStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, deploymentName, jobId, accept, requestOptions, + Context.NONE); + } + + /** + * Gets the status of an existing deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing deployment job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentStatusWithResponseAsync(String projectName, String deploymentName, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDeploymentStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, deploymentName, jobId, accept, requestOptions, + context)); + } + + /** + * Gets the status of an existing deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param deploymentName Represents deployment name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing deployment job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentStatusWithResponse(String projectName, String deploymentName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDeploymentStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, deploymentName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> swapDeploymentsWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.swapDeployments(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, context)); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response swapDeploymentsWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.swapDeploymentsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginSwapDeploymentsAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.swapDeploymentsWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginSwapDeployments(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.swapDeploymentsWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginSwapDeploymentsWithModelAsync(String projectName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.swapDeploymentsWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringSwapDeploymentsJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Swaps two existing deployments with each other. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     firstDeploymentName: String (Required)
+     *     secondDeploymentName: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The job object to swap two deployments. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginSwapDeploymentsWithModel(String projectName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.swapDeploymentsWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringSwapDeploymentsJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Gets the status of an existing swap deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing swap deployment job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSwapDeploymentsStatusWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSwapDeploymentsStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status of an existing swap deployment job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing swap deployment job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSwapDeploymentsStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSwapDeploymentsStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     resultUrl: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an export job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportStatusWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getExportStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status of an export job. Once job completes, returns the project metadata, and assets. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     resultUrl: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an export job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getExportStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listExportedModelsSinglePageAsync(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listExportedModels(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listExportedModelsAsync(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listExportedModelsSinglePageAsync(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listExportedModelsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listExportedModelsSinglePage(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listExportedModelsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the exported models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listExportedModels(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listExportedModelsSinglePage(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listExportedModelsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the details of an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of an exported model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelWithResponseAsync(String projectName, String exportedModelName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getExportedModel(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, exportedModelName, accept, requestOptions, context)); + } + + /** + * Gets the details of an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of an exported model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getExportedModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, exportedModelName, accept, requestOptions, Context.NONE); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateExportedModelWithResponseAsync(String projectName, + String exportedModelName, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateExportedModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, contentType, accept, body, + requestOptions, context)); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateExportedModelWithResponse(String projectName, String exportedModelName, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateExportedModelSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, contentType, accept, body, + requestOptions, Context.NONE); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrUpdateExportedModelAsync(String projectName, + String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrUpdateExportedModelWithResponseAsync(projectName, exportedModelName, body, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrUpdateExportedModel(String projectName, + String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrUpdateExportedModelWithResponse(projectName, exportedModelName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrUpdateExportedModelWithModelAsync( + String projectName, String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrUpdateExportedModelWithResponseAsync(projectName, exportedModelName, body, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportedModelJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Creates a new exported model or replaces an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainedModelLabel: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param body The exported model info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrUpdateExportedModelWithModel( + String projectName, String exportedModelName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrUpdateExportedModelWithResponse(projectName, exportedModelName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportedModelJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteExportedModelWithResponseAsync(String projectName, String exportedModelName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteExportedModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, accept, requestOptions, + context)); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteExportedModelWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteExportedModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, exportedModelName, accept, requestOptions, Context.NONE); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteExportedModelAsync(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteExportedModelWithResponseAsync(projectName, exportedModelName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteExportedModel(String projectName, String exportedModelName, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteExportedModelWithResponse(projectName, exportedModelName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteExportedModelWithModelAsync( + String projectName, String exportedModelName, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteExportedModelWithResponseAsync(projectName, exportedModelName, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportedModelJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing exported model. + * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginDeleteExportedModelWithModel(String projectName, String exportedModelName, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteExportedModelWithResponse(projectName, exportedModelName, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringExportedModelJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Gets the status for an existing job to create or update an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an existing job to create or update an exported model along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelJobStatusWithResponseAsync(String projectName, + String exportedModelName, String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getExportedModelJobStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, jobId, accept, requestOptions, + context)); + } + + /** + * Gets the status for an existing job to create or update an exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param exportedModelName The exported model name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an existing job to create or update an exported model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelJobStatusWithResponse(String projectName, String exportedModelName, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getExportedModelJobStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, jobId, accept, requestOptions, + Context.NONE); + } + + /** + * Gets the details and URL needed to download the exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelFiles (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             contentUri: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details and URL needed to download the exported model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExportedModelManifestWithResponseAsync(String projectName, + String exportedModelName, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getExportedModelManifest(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, accept, requestOptions, + context)); + } + + /** + * Gets the details and URL needed to download the exported model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelFiles (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             contentUri: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param exportedModelName The exported model name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details and URL needed to download the exported model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExportedModelManifestWithResponse(String projectName, String exportedModelName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getExportedModelManifestSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, exportedModelName, accept, requestOptions, + Context.NONE); + } + + /** + * Gets the status for an import. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an import along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getImportStatusWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getImportStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status for an import. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an import along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getImportStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getImportStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainedModelsSinglePageAsync(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainedModels(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainedModelsAsync(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainedModelsSinglePageAsync(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainedModelsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainedModelsSinglePage(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainedModelsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the trained models belonging to a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainedModels(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainedModelsSinglePage(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainedModelsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the details of a trained model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a trained model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainedModelWithResponseAsync(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getTrainedModel(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, accept, requestOptions, context)); + } + + /** + * Gets the details of a trained model. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a trained model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getTrainedModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, accept, requestOptions, Context.NONE); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTrainedModelWithResponseAsync(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTrainedModel(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, accept, requestOptions, + context)); + } + + /** + * Deletes an existing trained model. + * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTrainedModelWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteTrainedModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, accept, requestOptions, Context.NONE); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> evaluateModelWithResponseAsync(String projectName, String trainedModelLabel, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.evaluateModel(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, contentType, accept, body, requestOptions, context)); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response evaluateModelWithResponse(String projectName, String trainedModelLabel, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.evaluateModelSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginEvaluateModelAsync(String projectName, String trainedModelLabel, + BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.evaluateModelWithResponseAsync(projectName, trainedModelLabel, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginEvaluateModel(String projectName, String trainedModelLabel, + BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.evaluateModelWithResponse(projectName, trainedModelLabel, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginEvaluateModelWithModelAsync(String projectName, String trainedModelLabel, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.evaluateModelWithResponseAsync(projectName, trainedModelLabel, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringEvaluationJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringEvaluationJobResult.class)); + } + + /** + * Triggers evaluation operation on a trained model. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(percentage/manual) (Optional)
+     *     trainingSplitPercentage: Integer (Optional)
+     *     testingSplitPercentage: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param body The training input parameters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginEvaluateModelWithModel(String projectName, String trainedModelLabel, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.evaluateModelWithResponse(projectName, trainedModelLabel, body, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringEvaluationJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringEvaluationJobResult.class)); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> loadSnapshotWithResponseAsync(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.loadSnapshot(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, accept, requestOptions, context)); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response loadSnapshotWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.loadSnapshotSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, accept, requestOptions, Context.NONE); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginLoadSnapshotAsync(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.loadSnapshotWithResponseAsync(projectName, trainedModelLabel, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLoadSnapshot(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.loadSnapshotWithResponse(projectName, trainedModelLabel, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginLoadSnapshotWithModelAsync(String projectName, String trainedModelLabel, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.loadSnapshotWithResponseAsync(projectName, trainedModelLabel, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringLoadSnapshotJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Long-running operation. + * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginLoadSnapshotWithModel(String projectName, + String trainedModelLabel, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.loadSnapshotWithResponse(projectName, trainedModelLabel, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringLoadSnapshotJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Gets the status for an evaluation job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         evaluationOptions (Required): {
+     *             kind: String(percentage/manual) (Optional)
+     *             trainingSplitPercentage: Integer (Optional)
+     *             testingSplitPercentage: Integer (Optional)
+     *         }
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         percentComplete: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an evaluation job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getEvaluationStatusWithResponseAsync(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getEvaluationStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, jobId, accept, requestOptions, + context)); + } + + /** + * Gets the status for an evaluation job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         evaluationOptions (Required): {
+     *             kind: String(percentage/manual) (Optional)
+     *             trainingSplitPercentage: Integer (Optional)
+     *             testingSplitPercentage: Integer (Optional)
+     *         }
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         percentComplete: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for an evaluation job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEvaluationStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getEvaluationStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, trainedModelLabel, jobId, accept, requestOptions, Context.NONE); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getModelEvaluationResultsSinglePageAsync(String projectName, + String trainedModelLabel, String stringIndexType, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getModelEvaluationResults(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, stringIndexType, accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getModelEvaluationResultsAsync(String projectName, String trainedModelLabel, + String stringIndexType, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getModelEvaluationResultsSinglePageAsync(projectName, trainedModelLabel, stringIndexType, + requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getModelEvaluationResultsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getModelEvaluationResultsSinglePage(String projectName, String trainedModelLabel, + String stringIndexType, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getModelEvaluationResultsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, stringIndexType, accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param stringIndexType Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the detailed results of the evaluation for a trained model as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getModelEvaluationResults(String projectName, String trainedModelLabel, + String stringIndexType, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getModelEvaluationResultsSinglePage(projectName, trainedModelLabel, stringIndexType, + requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getModelEvaluationResultsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     evaluationOptions (Required): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the evaluation summary of a trained model along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelEvaluationSummaryWithResponseAsync(String projectName, + String trainedModelLabel, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getModelEvaluationSummary(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, accept, requestOptions, + context)); + } + + /** + * Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the + * model e.g., F1, Precision, Recall, etc. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     evaluationOptions (Required): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param trainedModelLabel The trained model label. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the evaluation summary of a trained model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelEvaluationSummaryWithResponse(String projectName, String trainedModelLabel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getModelEvaluationSummarySync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, accept, requestOptions, + Context.NONE); + } + + /** + * Gets the status for loading a snapshot. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for loading a snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadSnapshotStatusWithResponseAsync(String projectName, + String trainedModelLabel, String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLoadSnapshotStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, jobId, accept, requestOptions, + context)); + } + + /** + * Gets the status for loading a snapshot. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param trainedModelLabel The trained model label. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for loading a snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLoadSnapshotStatusWithResponse(String projectName, String trainedModelLabel, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLoadSnapshotStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, trainedModelLabel, jobId, accept, requestOptions, + Context.NONE); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentResourcesSinglePageAsync(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeploymentResources(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentResourcesAsync(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentResourcesSinglePageAsync(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentResourcesNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentResourcesSinglePage(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listDeploymentResourcesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the deployments resources assigned to the project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentResources(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentResourcesSinglePage(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listDeploymentResourcesNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> assignDeploymentResourcesWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.assignDeploymentResources(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, body, requestOptions, + context)); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response assignDeploymentResourcesWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.assignDeploymentResourcesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, body, requestOptions, + Context.NONE); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAssignDeploymentResourcesAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.assignDeploymentResourcesWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAssignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.assignDeploymentResourcesWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginAssignDeploymentResourcesWithModelAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.assignDeploymentResourcesWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringAssignDeploymentResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * 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. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     resourcesMetadata (Required): [
+     *          (Required){
+     *             azureResourceId: String (Required)
+     *             customDomain: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The new project resources info. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginAssignDeploymentResourcesWithModel(String projectName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.assignDeploymentResourcesWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringAssignDeploymentResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unassignDeploymentResourcesWithResponseAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.unassignDeploymentResources(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, body, requestOptions, + context)); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response unassignDeploymentResourcesWithResponse(String projectName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.unassignDeploymentResourcesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, contentType, accept, body, requestOptions, + Context.NONE); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUnassignDeploymentResourcesAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.unassignDeploymentResourcesWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUnassignDeploymentResources(String projectName, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.unassignDeploymentResourcesWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginUnassignDeploymentResourcesWithModelAsync(String projectName, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.unassignDeploymentResourcesWithResponseAsync(projectName, body, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringUnassignDeploymentResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes + * existing deployments assigned to them. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     assignedResourceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The name of the project to use. + * @param body The info for the deployment resources to be deleted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginUnassignDeploymentResourcesWithModel(String projectName, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.unassignDeploymentResourcesWithResponse(projectName, body, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(TextAnalysisAuthoringUnassignDeploymentResourcesJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Gets the status of an existing assign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing assign deployment resources job along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAssignDeploymentResourcesStatusWithResponseAsync(String projectName, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAssignDeploymentResourcesStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status of an existing assign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing assign deployment resources job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAssignDeploymentResourcesStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Gets the status of an existing unassign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing unassign deployment resources job along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUnassignDeploymentResourcesStatusWithResponseAsync(String projectName, + String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getUnassignDeploymentResourcesStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status of an existing unassign deployment resources job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of an existing unassign deployment resources job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUnassignDeploymentResourcesStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getUnassignDeploymentResourcesStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainingJobsSinglePageAsync(String projectName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainingJobs(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingJobsAsync(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingJobsSinglePageAsync(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingJobsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainingJobsSinglePage(String projectName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainingJobsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the non-expired training jobs created for a project. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingJobs(String projectName, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingJobsSinglePage(projectName, requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingJobsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Gets the status for a training job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a training job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainingStatusWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTrainingStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Gets the status for a training job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param projectName The new project name. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a training job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getTrainingStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelTrainingJobWithResponseAsync(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.cancelTrainingJob(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectName, jobId, accept, requestOptions, context)); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response cancelTrainingJobWithResponse(String projectName, String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.cancelTrainingJobSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + projectName, jobId, accept, requestOptions, Context.NONE); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCancelTrainingJobAsync(String projectName, String jobId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.cancelTrainingJobWithResponseAsync(projectName, jobId, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCancelTrainingJob(String projectName, String jobId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.cancelTrainingJobWithResponse(projectName, jobId, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginCancelTrainingJobWithModelAsync(String projectName, String jobId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.cancelTrainingJobWithResponseAsync(projectName, jobId, requestOptions), + new com.azure.ai.language.text.authoring.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobResult.class)); + } + + /** + * Triggers a cancellation for a running training job. + * + * @param projectName The name of the project to use. + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginCancelTrainingJobWithModel(String projectName, String jobId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.cancelTrainingJobWithResponse(projectName, jobId, requestOptions), + new com.azure.ai.language.text.authoring.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{Endpoint}/language".replace("{Endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobState.class), + TypeReference.createInstance(TextAnalysisAuthoringTrainingJobResult.class)); + } + + /** + * Gets the status for a project deletion job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a project deletion job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getProjectDeletionStatusWithResponseAsync(String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getProjectDeletionStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), jobId, accept, requestOptions, context)); + } + + /** + * Gets the status for a project deletion job. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The job ID. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status for a project deletion job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProjectDeletionStatusWithResponse(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getProjectDeletionStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), jobId, accept, requestOptions, Context.NONE); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAssignedResourceDeploymentsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAssignedResourceDeployments(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAssignedResourceDeploymentsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssignedResourceDeploymentsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssignedResourceDeploymentsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAssignedResourceDeploymentsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAssignedResourceDeploymentsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * 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. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssignedResourceDeployments(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssignedResourceDeploymentsSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listAssignedResourceDeploymentsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedLanguagesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSupportedLanguages(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedLanguagesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getSupportedLanguagesSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getSupportedLanguagesNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getSupportedLanguagesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getSupportedLanguagesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the supported languages. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedLanguages(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getSupportedLanguagesSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return getSupportedLanguagesNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedPrebuiltEntitiesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSupportedPrebuiltEntities(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSupportedPrebuiltEntitiesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getSupportedPrebuiltEntitiesSinglePageAsync(requestOptions), + nextLink -> getSupportedPrebuiltEntitiesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getSupportedPrebuiltEntitiesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getSupportedPrebuiltEntitiesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSupportedPrebuiltEntities(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getSupportedPrebuiltEntitiesSinglePage(requestOptions), + nextLink -> getSupportedPrebuiltEntitiesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainingConfigVersionsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainingConfigVersions(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTrainingConfigVersionsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingConfigVersionsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingConfigVersionsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainingConfigVersionsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainingConfigVersionsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
projectKindStringNoThe project kind, default value is + * CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification", + * "CustomMultiLabelClassification", "CustomEntityRecognition", "CustomAbstractiveSummarization", + * "CustomHealthcare", "CustomTextSentiment".
topIntegerNoThe number of result items to return.
skipIntegerNoThe number of result items to skip.
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTrainingConfigVersions(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingConfigVersionsSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTrainingConfigVersionsNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProjectsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listProjectsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     storageInputContainerName: String (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: Double (Optional)
+     *         amlProjectPath: String (Optional)
+     *         isLabelingLocked: Boolean (Optional)
+     *         runGptPredictions: Boolean (Optional)
+     *         gptPredictiveLookahead: Integer (Optional)
+     *     }
+     *     projectName: String (Required)
+     *     multilingual: Boolean (Optional)
+     *     description: String (Optional)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectMetadata items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProjectsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.listProjectsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeploymentsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     deploymentName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastDeployedDateTime: OffsetDateTime (Required)
+     *     deploymentExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     assignedResources (Required): [
+     *          (Required){
+     *             resourceId: String (Required)
+     *             region: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectDeployment items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listDeploymentsNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listExportedModelsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listExportedModelsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exportedModelName: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastExportedModelDateTime: OffsetDateTime (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringExportedTrainedModel items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listExportedModelsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listExportedModelsNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainedModelsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainedModelsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     label: String (Required)
+     *     modelId: String (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Required)
+     *     lastTrainingDurationInSeconds: int (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     *     modelTrainingConfigVersion: String (Required)
+     *     hasSnapshot: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringProjectTrainedModel items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainedModelsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainedModelsNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringDocumentEvaluationResult items along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getModelEvaluationResultsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getModelEvaluationResultsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(CustomSingleLabelClassification/CustomMultiLabelClassification/CustomEntityRecognition/CustomAbstractiveSummarization/CustomHealthcare/CustomTextSentiment) (Required)
+     *     location: String (Required)
+     *     language: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringDocumentEvaluationResult items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getModelEvaluationResultsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getModelEvaluationResultsNextSync(nextLink, this.client.getEndpoint(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentResourcesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeploymentResourcesNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     azureResourceId: String (Required)
+     *     region: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedDeploymentResource items along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDeploymentResourcesNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listDeploymentResourcesNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainingJobsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainingJobsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     jobId: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastUpdatedDateTime: OffsetDateTime (Required)
+     *     expirationDateTime: OffsetDateTime (Optional)
+     *     status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String (Required)
+     *             message: String (Required)
+     *         }
+     *     ]
+     *     errors (Optional): [
+     *          (Optional){
+     *             code: String(InvalidRequest/InvalidArgument/Unauthorized/Forbidden/NotFound/ProjectNotFound/OperationNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchIndexNotFound/TooManyRequests/AzureCognitiveSearchThrottling/AzureCognitiveSearchIndexLimitReached/InternalServerError/ServiceUnavailable/Timeout/QuotaExceeded/Conflict/Warning) (Required)
+     *             message: String (Required)
+     *             target: String (Optional)
+     *             details (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *             innererror (Optional): {
+     *                 code: String(InvalidRequest/InvalidParameterValue/KnowledgeBaseNotFound/AzureCognitiveSearchNotFound/AzureCognitiveSearchThrottling/ExtractionFailure/InvalidRequestBodyFormat/EmptyRequest/MissingInputDocuments/InvalidDocument/ModelVersionIncorrect/InvalidDocumentBatch/UnsupportedLanguageCode/InvalidCountryHint) (Required)
+     *                 message: String (Required)
+     *                 details (Optional): {
+     *                     String: String (Required)
+     *                 }
+     *                 target: String (Optional)
+     *                 innererror (Optional): (recursive schema, see innererror above)
+     *             }
+     *         }
+     *     ]
+     *     result (Required): {
+     *         modelLabel: String (Required)
+     *         trainingConfigVersion: String (Required)
+     *         trainingStatus (Required): {
+     *             percentComplete: int (Required)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             status: String(notStarted/running/succeeded/failed/cancelled/cancelling/partiallyCompleted) (Required)
+     *         }
+     *         evaluationStatus (Optional): (recursive schema, see evaluationStatus above)
+     *         estimatedEndDateTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingJobState items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainingJobsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainingJobsNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssignedResourceDeploymentsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAssignedResourceDeploymentsNext(nextLink, this.client.getEndpoint(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectName: String (Required)
+     *     deploymentsMetadata (Required): [
+     *          (Required){
+     *             deploymentName: String (Required)
+     *             lastDeployedDateTime: OffsetDateTime (Required)
+     *             deploymentExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata items along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAssignedResourceDeploymentsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAssignedResourceDeploymentsNextSync(nextLink, this.client.getEndpoint(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedLanguagesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSupportedLanguagesNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     languageName: String (Required)
+     *     languageCode: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringSupportedLanguage items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getSupportedLanguagesNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getSupportedLanguagesNextSync(nextLink, this.client.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedPrebuiltEntitiesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSupportedPrebuiltEntitiesNext(nextLink, this.client.getEndpoint(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     category: String (Required)
+     *     description: String (Required)
+     *     examples: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringPrebuiltEntity items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getSupportedPrebuiltEntitiesNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.getSupportedPrebuiltEntitiesNextSync(nextLink, this.client.getEndpoint(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTrainingConfigVersionsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTrainingConfigVersionsNext(nextLink, this.client.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     trainingConfigVersion: String (Required)
+     *     modelExpirationDate: LocalDate (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TextAnalysisAuthoringTrainingConfigVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTrainingConfigVersionsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTrainingConfigVersionsNextSync(nextLink, this.client.getEndpoint(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/CopyProjectAuthorizationRequest.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/CopyProjectAuthorizationRequest.java new file mode 100644 index 000000000000..ca1af69d184c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/CopyProjectAuthorizationRequest.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.implementation.models; + +import com.azure.ai.language.text.authoring.models.ProjectKind; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CopyProjectAuthorizationRequest model. + */ +@Fluent +public final class CopyProjectAuthorizationRequest implements JsonSerializable { + /* + * Represents the project kind. + */ + @Generated + private final ProjectKind projectKind; + + /* + * The name of the storage container. + */ + @Generated + private String storageInputContainerName; + + /* + * Whether to allow an existing project to be overwritten using the resulting copy authorization. + */ + @Generated + private Boolean allowOverwrite; + + /** + * Creates an instance of CopyProjectAuthorizationRequest class. + * + * @param projectKind the projectKind value to set. + */ + @Generated + public CopyProjectAuthorizationRequest(ProjectKind projectKind) { + this.projectKind = projectKind; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the storageInputContainerName property: The name of the storage container. + * + * @return the storageInputContainerName value. + */ + @Generated + public String getStorageInputContainerName() { + return this.storageInputContainerName; + } + + /** + * Set the storageInputContainerName property: The name of the storage container. + * + * @param storageInputContainerName the storageInputContainerName value to set. + * @return the CopyProjectAuthorizationRequest object itself. + */ + @Generated + public CopyProjectAuthorizationRequest setStorageInputContainerName(String storageInputContainerName) { + this.storageInputContainerName = storageInputContainerName; + return this; + } + + /** + * Get the allowOverwrite property: Whether to allow an existing project to be overwritten using the resulting copy + * authorization. + * + * @return the allowOverwrite value. + */ + @Generated + public Boolean isAllowOverwrite() { + return this.allowOverwrite; + } + + /** + * Set the allowOverwrite property: Whether to allow an existing project to be overwritten using the resulting copy + * authorization. + * + * @param allowOverwrite the allowOverwrite value to set. + * @return the CopyProjectAuthorizationRequest object itself. + */ + @Generated + public CopyProjectAuthorizationRequest setAllowOverwrite(Boolean allowOverwrite) { + this.allowOverwrite = allowOverwrite; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + jsonWriter.writeBooleanField("allowOverwrite", this.allowOverwrite); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyProjectAuthorizationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyProjectAuthorizationRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopyProjectAuthorizationRequest. + */ + @Generated + public static CopyProjectAuthorizationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectKind projectKind = null; + String storageInputContainerName = null; + Boolean allowOverwrite = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else if ("storageInputContainerName".equals(fieldName)) { + storageInputContainerName = reader.getString(); + } else if ("allowOverwrite".equals(fieldName)) { + allowOverwrite = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + CopyProjectAuthorizationRequest deserializedCopyProjectAuthorizationRequest + = new CopyProjectAuthorizationRequest(projectKind); + deserializedCopyProjectAuthorizationRequest.storageInputContainerName = storageInputContainerName; + deserializedCopyProjectAuthorizationRequest.allowOverwrite = allowOverwrite; + + return deserializedCopyProjectAuthorizationRequest; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/package-info.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/package-info.java new file mode 100644 index 000000000000..f7921c218d2b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/models/package-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Authoring. + * 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>. + */ +package com.azure.ai.language.text.authoring.implementation.models; diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/package-info.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/package-info.java new file mode 100644 index 000000000000..e5709a23b3b0 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/implementation/package-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for Authoring. + * 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>. + */ +package com.azure.ai.language.text.authoring.implementation; diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/CompositionSetting.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/CompositionSetting.java new file mode 100644 index 000000000000..1eacd93c0b27 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/CompositionSetting.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CompositionSetting. + */ +public final class CompositionSetting extends ExpandableStringEnum { + /** + * Every component's match or prediction is returned as a separate instance of the entity. + */ + @Generated + public static final CompositionSetting SEPARATE_COMPONENTS = fromString("separateComponents"); + + /** + * 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. + */ + @Generated + public static final CompositionSetting COMBINE_COMPONENTS = fromString("combineComponents"); + + /** + * Creates a new instance of CompositionSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CompositionSetting() { + } + + /** + * Creates or finds a CompositionSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompositionSetting. + */ + @Generated + public static CompositionSetting fromString(String name) { + return fromString(name, CompositionSetting.class); + } + + /** + * Gets known CompositionSetting values. + * + * @return known CompositionSetting values. + */ + @Generated + public static Collection values() { + return values(CompositionSetting.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationConnectionInfo.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationConnectionInfo.java new file mode 100644 index 000000000000..ee6477012ee3 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationConnectionInfo.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the connection info for the Azure resource to use during data generation as part of training a custom + * model. + */ +@Immutable +public final class DataGenerationConnectionInfo implements JsonSerializable { + /* + * Connection type for data generation settings. Currently only supports Azure Open AI. + */ + @Generated + private final String kind = "azureOpenAI"; + + /* + * Resource ID for the data generation resource. Looks something like + * "/subscriptions//resourceGroups//providers/Microsoft.CognitiveServices/accounts/". + */ + @Generated + private final String resourceId; + + /* + * Deployment name of model to be used for synthetic data generation. + */ + @Generated + private final String deploymentName; + + /** + * Creates an instance of DataGenerationConnectionInfo class. + * + * @param resourceId the resourceId value to set. + * @param deploymentName the deploymentName value to set. + */ + @Generated + public DataGenerationConnectionInfo(String resourceId, String deploymentName) { + this.resourceId = resourceId; + this.deploymentName = deploymentName; + } + + /** + * Get the kind property: Connection type for data generation settings. Currently only supports Azure Open AI. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + + /** + * Get the resourceId property: Resource ID for the data generation resource. Looks something like + * "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the deploymentName property: Deployment name of model to be used for synthetic data generation. + * + * @return the deploymentName value. + */ + @Generated + public String getDeploymentName() { + return this.deploymentName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("deploymentName", this.deploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationConnectionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationConnectionInfo if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationConnectionInfo. + */ + @Generated + public static DataGenerationConnectionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String resourceId = null; + String deploymentName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + resourceId = reader.getString(); + } else if ("deploymentName".equals(fieldName)) { + deploymentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new DataGenerationConnectionInfo(resourceId, deploymentName); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationSettings.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationSettings.java new file mode 100644 index 000000000000..e322187b645e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/DataGenerationSettings.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the settings for using data generation as part of training a custom model. + */ +@Immutable +public final class DataGenerationSettings implements JsonSerializable { + /* + * If set to true, augment customer provided training data with synthetic data to improve model quality. + */ + @Generated + private final boolean enableDataGeneration; + + /* + * Represents the connection info for the Azure resource to use during data generation as part of training a custom + * model. + */ + @Generated + private final DataGenerationConnectionInfo dataGenerationConnectionInfo; + + /** + * Creates an instance of DataGenerationSettings class. + * + * @param enableDataGeneration the enableDataGeneration value to set. + * @param dataGenerationConnectionInfo the dataGenerationConnectionInfo value to set. + */ + @Generated + public DataGenerationSettings(boolean enableDataGeneration, + DataGenerationConnectionInfo dataGenerationConnectionInfo) { + this.enableDataGeneration = enableDataGeneration; + this.dataGenerationConnectionInfo = dataGenerationConnectionInfo; + } + + /** + * Get the enableDataGeneration property: If set to true, augment customer provided training data with synthetic + * data to improve model quality. + * + * @return the enableDataGeneration value. + */ + @Generated + public boolean isEnableDataGeneration() { + return this.enableDataGeneration; + } + + /** + * Get the dataGenerationConnectionInfo property: Represents the connection info for the Azure resource to use + * during data generation as part of training a custom model. + * + * @return the dataGenerationConnectionInfo value. + */ + @Generated + public DataGenerationConnectionInfo getDataGenerationConnectionInfo() { + return this.dataGenerationConnectionInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableDataGeneration", this.enableDataGeneration); + jsonWriter.writeJsonField("dataGenerationConnectionInfo", this.dataGenerationConnectionInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationSettings. + */ + @Generated + public static DataGenerationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean enableDataGeneration = false; + DataGenerationConnectionInfo dataGenerationConnectionInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDataGeneration".equals(fieldName)) { + enableDataGeneration = reader.getBoolean(); + } else if ("dataGenerationConnectionInfo".equals(fieldName)) { + dataGenerationConnectionInfo = DataGenerationConnectionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new DataGenerationSettings(enableDataGeneration, dataGenerationConnectionInfo); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Error.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Error.java new file mode 100644 index 000000000000..89cbc15d8b20 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Error.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The error object. + */ +@Immutable +public final class Error implements JsonSerializable { + /* + * One of a server-defined set of error codes. + */ + @Generated + private final ErrorCode code; + + /* + * A human-readable representation of the error. + */ + @Generated + private final String message; + + /* + * The target of the error. + */ + @Generated + private String target; + + /* + * An array of details about specific errors that led to this reported error. + */ + @Generated + private List details; + + /* + * An object containing more specific information than the current object about the error. + */ + @Generated + private InnerErrorModel innererror; + + /** + * Creates an instance of Error class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private Error(ErrorCode code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: One of a server-defined set of error codes. + * + * @return the code value. + */ + @Generated + public ErrorCode getCode() { + return this.code; + } + + /** + * Get the message property: A human-readable representation of the error. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The target of the error. + * + * @return the target value. + */ + @Generated + public String getTarget() { + return this.target; + } + + /** + * Get the details property: An array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + @Generated + public List getDetails() { + return this.details; + } + + /** + * Get the innererror property: An object containing more specific information than the current object about the + * error. + * + * @return the innererror value. + */ + @Generated + public InnerErrorModel getInnererror() { + return this.innererror; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("innererror", this.innererror); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Error. + */ + @Generated + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorCode code = null; + String message = null; + String target = null; + List details = null; + InnerErrorModel innererror = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = ErrorCode.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("target".equals(fieldName)) { + target = reader.getString(); + } else if ("details".equals(fieldName)) { + details = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else if ("innererror".equals(fieldName)) { + innererror = InnerErrorModel.fromJson(reader); + } else { + reader.skipChildren(); + } + } + Error deserializedError = new Error(code, message); + deserializedError.target = target; + deserializedError.details = details; + deserializedError.innererror = innererror; + + return deserializedError; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ErrorCode.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ErrorCode.java new file mode 100644 index 000000000000..0490d6c552c3 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ErrorCode.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Human-readable error code. + */ +public final class ErrorCode extends ExpandableStringEnum { + /** + * Static value InvalidRequest for ErrorCode. + */ + @Generated + public static final ErrorCode INVALID_REQUEST = fromString("InvalidRequest"); + + /** + * Static value InvalidArgument for ErrorCode. + */ + @Generated + public static final ErrorCode INVALID_ARGUMENT = fromString("InvalidArgument"); + + /** + * Static value Unauthorized for ErrorCode. + */ + @Generated + public static final ErrorCode UNAUTHORIZED = fromString("Unauthorized"); + + /** + * Static value Forbidden for ErrorCode. + */ + @Generated + public static final ErrorCode FORBIDDEN = fromString("Forbidden"); + + /** + * Static value NotFound for ErrorCode. + */ + @Generated + public static final ErrorCode NOT_FOUND = fromString("NotFound"); + + /** + * Static value ProjectNotFound for ErrorCode. + */ + @Generated + public static final ErrorCode PROJECT_NOT_FOUND = fromString("ProjectNotFound"); + + /** + * Static value OperationNotFound for ErrorCode. + */ + @Generated + public static final ErrorCode OPERATION_NOT_FOUND = fromString("OperationNotFound"); + + /** + * Static value AzureCognitiveSearchNotFound for ErrorCode. + */ + @Generated + public static final ErrorCode AZURE_COGNITIVE_SEARCH_NOT_FOUND = fromString("AzureCognitiveSearchNotFound"); + + /** + * Static value AzureCognitiveSearchIndexNotFound for ErrorCode. + */ + @Generated + public static final ErrorCode AZURE_COGNITIVE_SEARCH_INDEX_NOT_FOUND + = fromString("AzureCognitiveSearchIndexNotFound"); + + /** + * Static value TooManyRequests for ErrorCode. + */ + @Generated + public static final ErrorCode TOO_MANY_REQUESTS = fromString("TooManyRequests"); + + /** + * Static value AzureCognitiveSearchThrottling for ErrorCode. + */ + @Generated + public static final ErrorCode AZURE_COGNITIVE_SEARCH_THROTTLING = fromString("AzureCognitiveSearchThrottling"); + + /** + * Static value AzureCognitiveSearchIndexLimitReached for ErrorCode. + */ + @Generated + public static final ErrorCode AZURE_COGNITIVE_SEARCH_INDEX_LIMIT_REACHED + = fromString("AzureCognitiveSearchIndexLimitReached"); + + /** + * Static value InternalServerError for ErrorCode. + */ + @Generated + public static final ErrorCode INTERNAL_SERVER_ERROR = fromString("InternalServerError"); + + /** + * Static value ServiceUnavailable for ErrorCode. + */ + @Generated + public static final ErrorCode SERVICE_UNAVAILABLE = fromString("ServiceUnavailable"); + + /** + * Static value Timeout for ErrorCode. + */ + @Generated + public static final ErrorCode TIMEOUT = fromString("Timeout"); + + /** + * Static value QuotaExceeded for ErrorCode. + */ + @Generated + public static final ErrorCode QUOTA_EXCEEDED = fromString("QuotaExceeded"); + + /** + * Static value Conflict for ErrorCode. + */ + @Generated + public static final ErrorCode CONFLICT = fromString("Conflict"); + + /** + * Static value Warning for ErrorCode. + */ + @Generated + public static final ErrorCode WARNING = fromString("Warning"); + + /** + * Creates a new instance of ErrorCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ErrorCode() { + } + + /** + * Creates or finds a ErrorCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ErrorCode. + */ + @Generated + public static ErrorCode fromString(String name) { + return fromString(name, ErrorCode.class); + } + + /** + * Gets known ErrorCode values. + * + * @return known ErrorCode values. + */ + @Generated + public static Collection values() { + return values(ErrorCode.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/EvaluationKind.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/EvaluationKind.java new file mode 100644 index 000000000000..e2e659f3ea71 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/EvaluationKind.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for EvaluationKind. + */ +public final class EvaluationKind extends ExpandableStringEnum { + /** + * Split the data into training and test sets according to user-defined percentages. + */ + @Generated + public static final EvaluationKind PERCENTAGE = fromString("percentage"); + + /** + * Split the data according to the chosen dataset for every example in the data. + */ + @Generated + public static final EvaluationKind MANUAL = fromString("manual"); + + /** + * Creates a new instance of EvaluationKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public EvaluationKind() { + } + + /** + * Creates or finds a EvaluationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluationKind. + */ + @Generated + public static EvaluationKind fromString(String name) { + return fromString(name, EvaluationKind.class); + } + + /** + * Gets known EvaluationKind values. + * + * @return known EvaluationKind values. + */ + @Generated + public static Collection values() { + return values(EvaluationKind.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProject.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProject.java new file mode 100644 index 000000000000..e071b23e29c2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProject.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an exported project. + */ +@Fluent +public final class ExportedProject implements JsonSerializable { + /* + * The version of the exported file. + */ + @Generated + private final String projectFileVersion; + + /* + * Specifies the method used to interpret string offsets. For additional information see + * https://aka.ms/text-analytics-offsets. + */ + @Generated + private final StringIndexType stringIndexType; + + /* + * Represents the project metadata. + */ + @Generated + private final TextAnalysisAuthoringCreateProjectOptions metadata; + + /* + * Represents the project assets. + */ + @Generated + private ExportedProjectAssets assets; + + /** + * Creates an instance of ExportedProject class. + * + * @param projectFileVersion the projectFileVersion value to set. + * @param stringIndexType the stringIndexType value to set. + * @param metadata the metadata value to set. + */ + @Generated + public ExportedProject(String projectFileVersion, StringIndexType stringIndexType, + TextAnalysisAuthoringCreateProjectOptions metadata) { + this.projectFileVersion = projectFileVersion; + this.stringIndexType = stringIndexType; + this.metadata = metadata; + } + + /** + * Get the projectFileVersion property: The version of the exported file. + * + * @return the projectFileVersion value. + */ + @Generated + public String getProjectFileVersion() { + return this.projectFileVersion; + } + + /** + * Get the stringIndexType property: Specifies the method used to interpret string offsets. For additional + * information see https://aka.ms/text-analytics-offsets. + * + * @return the stringIndexType value. + */ + @Generated + public StringIndexType getStringIndexType() { + return this.stringIndexType; + } + + /** + * Get the metadata property: Represents the project metadata. + * + * @return the metadata value. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions getMetadata() { + return this.metadata; + } + + /** + * Get the assets property: Represents the project assets. + * + * @return the assets value. + */ + @Generated + public ExportedProjectAssets getAssets() { + return this.assets; + } + + /** + * Set the assets property: Represents the project assets. + * + * @param assets the assets value to set. + * @return the ExportedProject object itself. + */ + @Generated + public ExportedProject setAssets(ExportedProjectAssets assets) { + this.assets = assets; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectFileVersion", this.projectFileVersion); + jsonWriter.writeStringField("stringIndexType", + this.stringIndexType == null ? null : this.stringIndexType.toString()); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeJsonField("assets", this.assets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportedProject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportedProject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExportedProject. + */ + @Generated + public static ExportedProject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String projectFileVersion = null; + StringIndexType stringIndexType = null; + TextAnalysisAuthoringCreateProjectOptions metadata = null; + ExportedProjectAssets assets = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectFileVersion".equals(fieldName)) { + projectFileVersion = reader.getString(); + } else if ("stringIndexType".equals(fieldName)) { + stringIndexType = StringIndexType.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + metadata = TextAnalysisAuthoringCreateProjectOptions.fromJson(reader); + } else if ("assets".equals(fieldName)) { + assets = ExportedProjectAssets.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ExportedProject deserializedExportedProject + = new ExportedProject(projectFileVersion, stringIndexType, metadata); + deserializedExportedProject.assets = assets; + + return deserializedExportedProject; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProjectAssets.java new file mode 100644 index 000000000000..26af9b153439 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ExportedProjectAssets.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the assets of an exported project. + */ +@Immutable +public class ExportedProjectAssets implements JsonSerializable { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.fromString("ExportedProjectAssets"); + + /** + * Creates an instance of ExportedProjectAssets class. + */ + @Generated + public ExportedProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportedProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportedProjectAssets if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExportedProjectAssets. + */ + @Generated + public static ExportedProjectAssets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("projectKind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CustomAbstractiveSummarization".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets + .fromJson(readerToUse.reset()); + } else if ("CustomEntityRecognition".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets + .fromJson(readerToUse.reset()); + } else if ("CustomHealthcare".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomHealthcareProjectAssets.fromJson(readerToUse.reset()); + } else if ("CustomMultiLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + .fromJson(readerToUse.reset()); + } else if ("CustomSingleLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + .fromJson(readerToUse.reset()); + } else if ("CustomTextSentiment".equals(discriminatorValue)) { + return TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ExportedProjectAssets fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportedProjectAssets deserializedExportedProjectAssets = new ExportedProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedExportedProjectAssets.projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExportedProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorCode.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorCode.java new file mode 100644 index 000000000000..e44fb756d62f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorCode.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Human-readable error code. + */ +public final class InnerErrorCode extends ExpandableStringEnum { + /** + * Static value InvalidRequest for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_REQUEST = fromString("InvalidRequest"); + + /** + * Static value InvalidParameterValue for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_PARAMETER_VALUE = fromString("InvalidParameterValue"); + + /** + * Static value KnowledgeBaseNotFound for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode KNOWLEDGE_BASE_NOT_FOUND = fromString("KnowledgeBaseNotFound"); + + /** + * Static value AzureCognitiveSearchNotFound for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode AZURE_COGNITIVE_SEARCH_NOT_FOUND = fromString("AzureCognitiveSearchNotFound"); + + /** + * Static value AzureCognitiveSearchThrottling for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode AZURE_COGNITIVE_SEARCH_THROTTLING = fromString("AzureCognitiveSearchThrottling"); + + /** + * Static value ExtractionFailure for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode EXTRACTION_FAILURE = fromString("ExtractionFailure"); + + /** + * Static value InvalidRequestBodyFormat for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_REQUEST_BODY_FORMAT = fromString("InvalidRequestBodyFormat"); + + /** + * Static value EmptyRequest for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode EMPTY_REQUEST = fromString("EmptyRequest"); + + /** + * Static value MissingInputDocuments for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode MISSING_INPUT_DOCUMENTS = fromString("MissingInputDocuments"); + + /** + * Static value InvalidDocument for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_DOCUMENT = fromString("InvalidDocument"); + + /** + * Static value ModelVersionIncorrect for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode MODEL_VERSION_INCORRECT = fromString("ModelVersionIncorrect"); + + /** + * Static value InvalidDocumentBatch for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_DOCUMENT_BATCH = fromString("InvalidDocumentBatch"); + + /** + * Static value UnsupportedLanguageCode for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode UNSUPPORTED_LANGUAGE_CODE = fromString("UnsupportedLanguageCode"); + + /** + * Static value InvalidCountryHint for InnerErrorCode. + */ + @Generated + public static final InnerErrorCode INVALID_COUNTRY_HINT = fromString("InvalidCountryHint"); + + /** + * Creates a new instance of InnerErrorCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InnerErrorCode() { + } + + /** + * Creates or finds a InnerErrorCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding InnerErrorCode. + */ + @Generated + public static InnerErrorCode fromString(String name) { + return fromString(name, InnerErrorCode.class); + } + + /** + * Gets known InnerErrorCode values. + * + * @return known InnerErrorCode values. + */ + @Generated + public static Collection values() { + return values(InnerErrorCode.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorModel.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorModel.java new file mode 100644 index 000000000000..b039ca0c6667 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/InnerErrorModel.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * 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. + */ +@Immutable +public final class InnerErrorModel implements JsonSerializable { + /* + * One of a server-defined set of error codes. + */ + @Generated + private final InnerErrorCode code; + + /* + * Error message. + */ + @Generated + private final String message; + + /* + * Error details. + */ + @Generated + private Map details; + + /* + * Error target. + */ + @Generated + private String target; + + /* + * An object containing more specific information than the current object about the error. + */ + @Generated + private InnerErrorModel innererror; + + /** + * Creates an instance of InnerErrorModel class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private InnerErrorModel(InnerErrorCode code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: One of a server-defined set of error codes. + * + * @return the code value. + */ + @Generated + public InnerErrorCode getCode() { + return this.code; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the details property: Error details. + * + * @return the details value. + */ + @Generated + public Map getDetails() { + return this.details; + } + + /** + * Get the target property: Error target. + * + * @return the target value. + */ + @Generated + public String getTarget() { + return this.target; + } + + /** + * Get the innererror property: An object containing more specific information than the current object about the + * error. + * + * @return the innererror value. + */ + @Generated + public InnerErrorModel getInnererror() { + return this.innererror; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeMapField("details", this.details, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeJsonField("innererror", this.innererror); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InnerErrorModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InnerErrorModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InnerErrorModel. + */ + @Generated + public static InnerErrorModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InnerErrorCode code = null; + String message = null; + Map details = null; + String target = null; + InnerErrorModel innererror = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = InnerErrorCode.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("details".equals(fieldName)) { + details = reader.readMap(reader1 -> reader1.getString()); + } else if ("target".equals(fieldName)) { + target = reader.getString(); + } else if ("innererror".equals(fieldName)) { + innererror = InnerErrorModel.fromJson(reader); + } else { + reader.skipChildren(); + } + } + InnerErrorModel deserializedInnerErrorModel = new InnerErrorModel(code, message); + deserializedInnerErrorModel.details = details; + deserializedInnerErrorModel.target = target; + deserializedInnerErrorModel.innererror = innererror; + + return deserializedInnerErrorModel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/JobStatus.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/JobStatus.java new file mode 100644 index 000000000000..412f8cc049c5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/JobStatus.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for JobStatus. + */ +public final class JobStatus extends ExpandableStringEnum { + /** + * Static value notStarted for JobStatus. + */ + @Generated + public static final JobStatus NOT_STARTED = fromString("notStarted"); + + /** + * Static value running for JobStatus. + */ + @Generated + public static final JobStatus RUNNING = fromString("running"); + + /** + * Static value succeeded for JobStatus. + */ + @Generated + public static final JobStatus SUCCEEDED = fromString("succeeded"); + + /** + * Static value failed for JobStatus. + */ + @Generated + public static final JobStatus FAILED = fromString("failed"); + + /** + * Static value cancelled for JobStatus. + */ + @Generated + public static final JobStatus CANCELLED = fromString("cancelled"); + + /** + * Static value cancelling for JobStatus. + */ + @Generated + public static final JobStatus CANCELLING = fromString("cancelling"); + + /** + * Static value partiallyCompleted for JobStatus. + */ + @Generated + public static final JobStatus PARTIALLY_COMPLETED = fromString("partiallyCompleted"); + + /** + * Creates a new instance of JobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public JobStatus() { + } + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + @Generated + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * Gets known JobStatus values. + * + * @return known JobStatus values. + */ + @Generated + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectKind.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectKind.java new file mode 100644 index 000000000000..13dcd55979f8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectKind.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ProjectKind. + */ +public final class ProjectKind extends ExpandableStringEnum { + /** + * 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. + */ + @Generated + public static final ProjectKind CUSTOM_SINGLE_LABEL_CLASSIFICATION = fromString("CustomSingleLabelClassification"); + + /** + * 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. + */ + @Generated + public static final ProjectKind CUSTOM_MULTI_LABEL_CLASSIFICATION = fromString("CustomMultiLabelClassification"); + + /** + * For building an extraction model to identify your domain categories using your own data. + */ + @Generated + public static final ProjectKind CUSTOM_ENTITY_RECOGNITION = fromString("CustomEntityRecognition"); + + /** + * For building an abstractive summarization models which are able to summarize long documents. + */ + @Generated + public static final ProjectKind CUSTOM_ABSTRACTIVE_SUMMARIZATION = fromString("CustomAbstractiveSummarization"); + + /** + * For building an text analytics for health model to identify your health domain data. + */ + @Generated + public static final ProjectKind CUSTOM_HEALTHCARE = fromString("CustomHealthcare"); + + /** + * For building a sentiment models which are able to extract sentiment for long documents. + */ + @Generated + public static final ProjectKind CUSTOM_TEXT_SENTIMENT = fromString("CustomTextSentiment"); + + /** + * Creates a new instance of ProjectKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ProjectKind() { + } + + /** + * Creates or finds a ProjectKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectKind. + */ + @Generated + public static ProjectKind fromString(String name) { + return fromString(name, ProjectKind.class); + } + + /** + * Gets known ProjectKind values. + * + * @return known ProjectKind values. + */ + @Generated + public static Collection values() { + return values(ProjectKind.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectSettings.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectSettings.java new file mode 100644 index 000000000000..6e93db82861a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ProjectSettings.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.ai.language.text.authoring.implementation.JsonMergePatchHelper; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Represents the settings used to define the project behavior. + */ +@Fluent +public final class ProjectSettings implements JsonSerializable { + /* + * 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. + */ + @Generated + private Double confidenceThreshold; + + /* + * The path to the AML connected project. + */ + @Generated + private String amlProjectPath; + + /* + * Indicates whether the labeling experience can be modified or not. + */ + @Generated + private Boolean isLabelingLocked; + + /* + * Indicates whether to run GPT predictions or not. + */ + @Generated + private Boolean runGptPredictions; + + /* + * The predictive lookahead for GPT predictions that is specified by the user. + */ + @Generated + private Integer gptPredictiveLookahead; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setProjectSettingsAccessor(new JsonMergePatchHelper.ProjectSettingsAccessor() { + @Override + public ProjectSettings prepareModelForJsonMergePatch(ProjectSettings model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(ProjectSettings model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of ProjectSettings class. + */ + @Generated + public ProjectSettings() { + } + + /** + * Get the confidenceThreshold property: 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. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: 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. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the ProjectSettings object itself. + */ + @Generated + public ProjectSettings setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + this.updatedProperties.add("confidenceThreshold"); + return this; + } + + /** + * Get the amlProjectPath property: The path to the AML connected project. + * + * @return the amlProjectPath value. + */ + @Generated + public String getAmlProjectPath() { + return this.amlProjectPath; + } + + /** + * Set the amlProjectPath property: The path to the AML connected project. + * + * @param amlProjectPath the amlProjectPath value to set. + * @return the ProjectSettings object itself. + */ + @Generated + public ProjectSettings setAmlProjectPath(String amlProjectPath) { + this.amlProjectPath = amlProjectPath; + this.updatedProperties.add("amlProjectPath"); + return this; + } + + /** + * Get the isLabelingLocked property: Indicates whether the labeling experience can be modified or not. + * + * @return the isLabelingLocked value. + */ + @Generated + public Boolean isLabelingLocked() { + return this.isLabelingLocked; + } + + /** + * Set the isLabelingLocked property: Indicates whether the labeling experience can be modified or not. + * + * @param isLabelingLocked the isLabelingLocked value to set. + * @return the ProjectSettings object itself. + */ + @Generated + public ProjectSettings setIsLabelingLocked(Boolean isLabelingLocked) { + this.isLabelingLocked = isLabelingLocked; + this.updatedProperties.add("isLabelingLocked"); + return this; + } + + /** + * Get the runGptPredictions property: Indicates whether to run GPT predictions or not. + * + * @return the runGptPredictions value. + */ + @Generated + public Boolean isRunGptPredictions() { + return this.runGptPredictions; + } + + /** + * Set the runGptPredictions property: Indicates whether to run GPT predictions or not. + * + * @param runGptPredictions the runGptPredictions value to set. + * @return the ProjectSettings object itself. + */ + @Generated + public ProjectSettings setRunGptPredictions(Boolean runGptPredictions) { + this.runGptPredictions = runGptPredictions; + this.updatedProperties.add("runGptPredictions"); + return this; + } + + /** + * Get the gptPredictiveLookahead property: The predictive lookahead for GPT predictions that is specified by the + * user. + * + * @return the gptPredictiveLookahead value. + */ + @Generated + public Integer getGptPredictiveLookahead() { + return this.gptPredictiveLookahead; + } + + /** + * Set the gptPredictiveLookahead property: The predictive lookahead for GPT predictions that is specified by the + * user. + * + * @param gptPredictiveLookahead the gptPredictiveLookahead value to set. + * @return the ProjectSettings object itself. + */ + @Generated + public ProjectSettings setGptPredictiveLookahead(Integer gptPredictiveLookahead) { + this.gptPredictiveLookahead = gptPredictiveLookahead; + this.updatedProperties.add("gptPredictiveLookahead"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("confidenceThreshold", this.confidenceThreshold); + jsonWriter.writeStringField("amlProjectPath", this.amlProjectPath); + jsonWriter.writeBooleanField("isLabelingLocked", this.isLabelingLocked); + jsonWriter.writeBooleanField("runGptPredictions", this.runGptPredictions); + jsonWriter.writeNumberField("gptPredictiveLookahead", this.gptPredictiveLookahead); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("confidenceThreshold")) { + if (this.confidenceThreshold == null) { + jsonWriter.writeNullField("confidenceThreshold"); + } else { + jsonWriter.writeNumberField("confidenceThreshold", this.confidenceThreshold); + } + } + if (updatedProperties.contains("amlProjectPath")) { + if (this.amlProjectPath == null) { + jsonWriter.writeNullField("amlProjectPath"); + } else { + jsonWriter.writeStringField("amlProjectPath", this.amlProjectPath); + } + } + if (updatedProperties.contains("isLabelingLocked")) { + if (this.isLabelingLocked == null) { + jsonWriter.writeNullField("isLabelingLocked"); + } else { + jsonWriter.writeBooleanField("isLabelingLocked", this.isLabelingLocked); + } + } + if (updatedProperties.contains("runGptPredictions")) { + if (this.runGptPredictions == null) { + jsonWriter.writeNullField("runGptPredictions"); + } else { + jsonWriter.writeBooleanField("runGptPredictions", this.runGptPredictions); + } + } + if (updatedProperties.contains("gptPredictiveLookahead")) { + if (this.gptPredictiveLookahead == null) { + jsonWriter.writeNullField("gptPredictiveLookahead"); + } else { + jsonWriter.writeNumberField("gptPredictiveLookahead", this.gptPredictiveLookahead); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectSettings. + */ + @Generated + public static ProjectSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectSettings deserializedProjectSettings = new ProjectSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confidenceThreshold".equals(fieldName)) { + deserializedProjectSettings.confidenceThreshold = reader.getNullable(JsonReader::getDouble); + } else if ("amlProjectPath".equals(fieldName)) { + deserializedProjectSettings.amlProjectPath = reader.getString(); + } else if ("isLabelingLocked".equals(fieldName)) { + deserializedProjectSettings.isLabelingLocked = reader.getNullable(JsonReader::getBoolean); + } else if ("runGptPredictions".equals(fieldName)) { + deserializedProjectSettings.runGptPredictions = reader.getNullable(JsonReader::getBoolean); + } else if ("gptPredictiveLookahead".equals(fieldName)) { + deserializedProjectSettings.gptPredictiveLookahead = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectSettings; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ResourceMetadata.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ResourceMetadata.java new file mode 100644 index 000000000000..fbf70d3bd22a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/ResourceMetadata.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents metadata for the Azure resource.. + */ +@Immutable +public final class ResourceMetadata implements JsonSerializable { + /* + * Represents the Azure resource ID. + */ + @Generated + private final String azureResourceId; + + /* + * Represents the Azure resource custom domain. + */ + @Generated + private final String customDomain; + + /* + * Represents the Azure resource region. + */ + @Generated + private final String region; + + /** + * Creates an instance of ResourceMetadata class. + * + * @param azureResourceId the azureResourceId value to set. + * @param customDomain the customDomain value to set. + * @param region the region value to set. + */ + @Generated + public ResourceMetadata(String azureResourceId, String customDomain, String region) { + this.azureResourceId = azureResourceId; + this.customDomain = customDomain; + this.region = region; + } + + /** + * Get the azureResourceId property: Represents the Azure resource ID. + * + * @return the azureResourceId value. + */ + @Generated + public String getAzureResourceId() { + return this.azureResourceId; + } + + /** + * Get the customDomain property: Represents the Azure resource custom domain. + * + * @return the customDomain value. + */ + @Generated + public String getCustomDomain() { + return this.customDomain; + } + + /** + * Get the region property: Represents the Azure resource region. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("customDomain", this.customDomain); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceMetadata. + */ + @Generated + public static ResourceMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String azureResourceId = null; + String customDomain = null; + String region = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + azureResourceId = reader.getString(); + } else if ("customDomain".equals(fieldName)) { + customDomain = reader.getString(); + } else if ("region".equals(fieldName)) { + region = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ResourceMetadata(azureResourceId, customDomain, region); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Sentiment.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Sentiment.java new file mode 100644 index 000000000000..cd7349a9275c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/Sentiment.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for Sentiment. + */ +public final class Sentiment extends ExpandableStringEnum { + /** + * Static value positive for Sentiment. + */ + @Generated + public static final Sentiment POSITIVE = fromString("positive"); + + /** + * Static value negative for Sentiment. + */ + @Generated + public static final Sentiment NEGATIVE = fromString("negative"); + + /** + * Static value neutral for Sentiment. + */ + @Generated + public static final Sentiment NEUTRAL = fromString("neutral"); + + /** + * Creates a new instance of Sentiment value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public Sentiment() { + } + + /** + * Creates or finds a Sentiment from its string representation. + * + * @param name a name to look for. + * @return the corresponding Sentiment. + */ + @Generated + public static Sentiment fromString(String name) { + return fromString(name, Sentiment.class); + } + + /** + * Gets known Sentiment values. + * + * @return known Sentiment values. + */ + @Generated + public static Collection values() { + return values(Sentiment.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/StringIndexType.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/StringIndexType.java new file mode 100644 index 000000000000..ad0378bb7748 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/StringIndexType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for StringIndexType. + */ +public final class StringIndexType extends ExpandableStringEnum { + /** + * 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. + */ + @Generated + public static final StringIndexType UTF16CODE_UNIT = fromString("Utf16CodeUnit"); + + /** + * Creates a new instance of StringIndexType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public StringIndexType() { + } + + /** + * Creates or finds a StringIndexType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StringIndexType. + */ + @Generated + public static StringIndexType fromString(String name) { + return fromString(name, StringIndexType.class); + } + + /** + * Gets known StringIndexType values. + * + * @return known StringIndexType values. + */ + @Generated + public static Collection values() { + return values(StringIndexType.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesJobState.java new file mode 100644 index 000000000000..27d9eedb2d0b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesJobState.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a assign deployment resources job. + */ +@Immutable +public final class TextAnalysisAuthoringAssignDeploymentResourcesJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringAssignDeploymentResourcesJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringAssignDeploymentResourcesJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringAssignDeploymentResourcesJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringAssignDeploymentResourcesJobState if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringAssignDeploymentResourcesJobState. + */ + @Generated + public static TextAnalysisAuthoringAssignDeploymentResourcesJobState fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringAssignDeploymentResourcesJobState deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState + = new TextAnalysisAuthoringAssignDeploymentResourcesJobState(createdDateTime, lastUpdatedDateTime, + status); + deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState.jobId = jobId; + deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState.warnings = warnings; + deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState.errors = errors; + + return deserializedTextAnalysisAuthoringAssignDeploymentResourcesJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesOptions.java new file mode 100644 index 000000000000..6c78bc8e97bb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignDeploymentResourcesOptions.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the options for assigning Azure resources to a project. + */ +@Immutable +public final class TextAnalysisAuthoringAssignDeploymentResourcesOptions + implements JsonSerializable { + /* + * Represents the metadata for the resources to be assigned. + */ + @Generated + private final List resourcesMetadata; + + /** + * Creates an instance of TextAnalysisAuthoringAssignDeploymentResourcesOptions class. + * + * @param resourcesMetadata the resourcesMetadata value to set. + */ + @Generated + public TextAnalysisAuthoringAssignDeploymentResourcesOptions(List resourcesMetadata) { + this.resourcesMetadata = resourcesMetadata; + } + + /** + * Get the resourcesMetadata property: Represents the metadata for the resources to be assigned. + * + * @return the resourcesMetadata value. + */ + @Generated + public List getResourcesMetadata() { + return this.resourcesMetadata; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourcesMetadata", this.resourcesMetadata, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringAssignDeploymentResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringAssignDeploymentResourcesOptions if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringAssignDeploymentResourcesOptions. + */ + @Generated + public static TextAnalysisAuthoringAssignDeploymentResourcesOptions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List resourcesMetadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourcesMetadata".equals(fieldName)) { + resourcesMetadata = reader.readArray(reader1 -> ResourceMetadata.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringAssignDeploymentResourcesOptions(resourcesMetadata); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedDeploymentResource.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedDeploymentResource.java new file mode 100644 index 000000000000..49190db75e58 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedDeploymentResource.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the assigned deployment resource. + */ +@Immutable +public final class TextAnalysisAuthoringAssignedDeploymentResource + implements JsonSerializable { + /* + * The resource ID. + */ + @Generated + private String azureResourceId; + + /* + * The resource region. + */ + @Generated + private final String region; + + /** + * Creates an instance of TextAnalysisAuthoringAssignedDeploymentResource class. + * + * @param region the region value to set. + */ + @Generated + private TextAnalysisAuthoringAssignedDeploymentResource(String region) { + this.region = region; + } + + /** + * Get the azureResourceId property: The resource ID. + * + * @return the azureResourceId value. + */ + @Generated + public String getAzureResourceId() { + return this.azureResourceId; + } + + /** + * Get the region property: The resource region. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringAssignedDeploymentResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringAssignedDeploymentResource if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringAssignedDeploymentResource. + */ + @Generated + public static TextAnalysisAuthoringAssignedDeploymentResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String azureResourceId = null; + String region = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + azureResourceId = reader.getString(); + } else if ("region".equals(fieldName)) { + region = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringAssignedDeploymentResource deserializedTextAnalysisAuthoringAssignedDeploymentResource + = new TextAnalysisAuthoringAssignedDeploymentResource(region); + deserializedTextAnalysisAuthoringAssignedDeploymentResource.azureResourceId = azureResourceId; + + return deserializedTextAnalysisAuthoringAssignedDeploymentResource; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentMetadata.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentMetadata.java new file mode 100644 index 000000000000..061894dda831 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentMetadata.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +/** + * Represents the metadata for an assigned deployment. + */ +@Immutable +public final class TextAnalysisAuthoringAssignedProjectDeploymentMetadata + implements JsonSerializable { + /* + * Represents the deployment name. + */ + @Generated + private final String deploymentName; + + /* + * Represents deployment last deployed time. + */ + @Generated + private final OffsetDateTime lastDeployedDateTime; + + /* + * Represents deployment expiration date in the runtime. + */ + @Generated + private final LocalDate deploymentExpirationDate; + + /** + * Creates an instance of TextAnalysisAuthoringAssignedProjectDeploymentMetadata class. + * + * @param deploymentName the deploymentName value to set. + * @param lastDeployedDateTime the lastDeployedDateTime value to set. + * @param deploymentExpirationDate the deploymentExpirationDate value to set. + */ + @Generated + private TextAnalysisAuthoringAssignedProjectDeploymentMetadata(String deploymentName, + OffsetDateTime lastDeployedDateTime, LocalDate deploymentExpirationDate) { + this.deploymentName = deploymentName; + this.lastDeployedDateTime = lastDeployedDateTime; + this.deploymentExpirationDate = deploymentExpirationDate; + } + + /** + * Get the deploymentName property: Represents the deployment name. + * + * @return the deploymentName value. + */ + @Generated + public String getDeploymentName() { + return this.deploymentName; + } + + /** + * Get the lastDeployedDateTime property: Represents deployment last deployed time. + * + * @return the lastDeployedDateTime value. + */ + @Generated + public OffsetDateTime getLastDeployedDateTime() { + return this.lastDeployedDateTime; + } + + /** + * Get the deploymentExpirationDate property: Represents deployment expiration date in the runtime. + * + * @return the deploymentExpirationDate value. + */ + @Generated + public LocalDate getDeploymentExpirationDate() { + return this.deploymentExpirationDate; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentName", this.deploymentName); + jsonWriter.writeStringField("lastDeployedDateTime", + this.lastDeployedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastDeployedDateTime)); + jsonWriter.writeStringField("deploymentExpirationDate", Objects.toString(this.deploymentExpirationDate, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringAssignedProjectDeploymentMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringAssignedProjectDeploymentMetadata if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringAssignedProjectDeploymentMetadata. + */ + @Generated + public static TextAnalysisAuthoringAssignedProjectDeploymentMetadata fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String deploymentName = null; + OffsetDateTime lastDeployedDateTime = null; + LocalDate deploymentExpirationDate = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentName".equals(fieldName)) { + deploymentName = reader.getString(); + } else if ("lastDeployedDateTime".equals(fieldName)) { + lastDeployedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deploymentExpirationDate".equals(fieldName)) { + deploymentExpirationDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringAssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, + deploymentExpirationDate); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.java new file mode 100644 index 000000000000..0877e2cbfbf5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringAssignedProjectDeploymentsMetadata.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the metadata for assigned deployments for a project. + */ +@Immutable +public final class TextAnalysisAuthoringAssignedProjectDeploymentsMetadata + implements JsonSerializable { + /* + * Represents the project name. + */ + @Generated + private String projectName; + + /* + * Represents the resource region. + */ + @Generated + private final List deploymentsMetadata; + + /** + * Creates an instance of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata class. + * + * @param deploymentsMetadata the deploymentsMetadata value to set. + */ + @Generated + private TextAnalysisAuthoringAssignedProjectDeploymentsMetadata( + List deploymentsMetadata) { + this.deploymentsMetadata = deploymentsMetadata; + } + + /** + * Get the projectName property: Represents the project name. + * + * @return the projectName value. + */ + @Generated + public String getProjectName() { + return this.projectName; + } + + /** + * Get the deploymentsMetadata property: Represents the resource region. + * + * @return the deploymentsMetadata value. + */ + @Generated + public List getDeploymentsMetadata() { + return this.deploymentsMetadata; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("deploymentsMetadata", this.deploymentsMetadata, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringAssignedProjectDeploymentsMetadata if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringAssignedProjectDeploymentsMetadata. + */ + @Generated + public static TextAnalysisAuthoringAssignedProjectDeploymentsMetadata fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String projectName = null; + List deploymentsMetadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectName".equals(fieldName)) { + projectName = reader.getString(); + } else if ("deploymentsMetadata".equals(fieldName)) { + deploymentsMetadata = reader + .readArray(reader1 -> TextAnalysisAuthoringAssignedProjectDeploymentMetadata.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringAssignedProjectDeploymentsMetadata deserializedTextAnalysisAuthoringAssignedProjectDeploymentsMetadata + = new TextAnalysisAuthoringAssignedProjectDeploymentsMetadata(deploymentsMetadata); + deserializedTextAnalysisAuthoringAssignedProjectDeploymentsMetadata.projectName = projectName; + + return deserializedTextAnalysisAuthoringAssignedProjectDeploymentsMetadata; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrix.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrix.java new file mode 100644 index 000000000000..73501f26bfa6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrix.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * The TextAnalysisAuthoringConfusionMatrix model. + */ +@Immutable +public final class TextAnalysisAuthoringConfusionMatrix + implements JsonSerializable { + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of TextAnalysisAuthoringConfusionMatrix class. + */ + @Generated + private TextAnalysisAuthoringConfusionMatrix() { + } + + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties + .entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringConfusionMatrix from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringConfusionMatrix if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringConfusionMatrix. + */ + @Generated + public static TextAnalysisAuthoringConfusionMatrix fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringConfusionMatrix deserializedTextAnalysisAuthoringConfusionMatrix + = new TextAnalysisAuthoringConfusionMatrix(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, TextAnalysisAuthoringConfusionMatrixRow.fromJson(reader)); + } + deserializedTextAnalysisAuthoringConfusionMatrix.additionalProperties = additionalProperties; + + return deserializedTextAnalysisAuthoringConfusionMatrix; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixCell.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixCell.java new file mode 100644 index 000000000000..2066b91aa744 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixCell.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a cell in a confusion matrix. + */ +@Immutable +public final class TextAnalysisAuthoringConfusionMatrixCell + implements JsonSerializable { + /* + * Represents normalized value in percentages. + */ + @Generated + private final double normalizedValue; + + /* + * Represents raw value. + */ + @Generated + private final double rawValue; + + /** + * Creates an instance of TextAnalysisAuthoringConfusionMatrixCell class. + * + * @param normalizedValue the normalizedValue value to set. + * @param rawValue the rawValue value to set. + */ + @Generated + private TextAnalysisAuthoringConfusionMatrixCell(double normalizedValue, double rawValue) { + this.normalizedValue = normalizedValue; + this.rawValue = rawValue; + } + + /** + * Get the normalizedValue property: Represents normalized value in percentages. + * + * @return the normalizedValue value. + */ + @Generated + public double getNormalizedValue() { + return this.normalizedValue; + } + + /** + * Get the rawValue property: Represents raw value. + * + * @return the rawValue value. + */ + @Generated + public double getRawValue() { + return this.rawValue; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("normalizedValue", this.normalizedValue); + jsonWriter.writeDoubleField("rawValue", this.rawValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringConfusionMatrixCell from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringConfusionMatrixCell if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringConfusionMatrixCell. + */ + @Generated + public static TextAnalysisAuthoringConfusionMatrixCell fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double normalizedValue = 0.0; + double rawValue = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("normalizedValue".equals(fieldName)) { + normalizedValue = reader.getDouble(); + } else if ("rawValue".equals(fieldName)) { + rawValue = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringConfusionMatrixCell(normalizedValue, rawValue); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixRow.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixRow.java new file mode 100644 index 000000000000..b56cf246cc33 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringConfusionMatrixRow.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * The TextAnalysisAuthoringConfusionMatrixRow model. + */ +@Immutable +public final class TextAnalysisAuthoringConfusionMatrixRow + implements JsonSerializable { + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of TextAnalysisAuthoringConfusionMatrixRow class. + */ + @Generated + private TextAnalysisAuthoringConfusionMatrixRow() { + } + + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties + .entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringConfusionMatrixRow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringConfusionMatrixRow if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringConfusionMatrixRow. + */ + @Generated + public static TextAnalysisAuthoringConfusionMatrixRow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringConfusionMatrixRow deserializedTextAnalysisAuthoringConfusionMatrixRow + = new TextAnalysisAuthoringConfusionMatrixRow(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, TextAnalysisAuthoringConfusionMatrixCell.fromJson(reader)); + } + deserializedTextAnalysisAuthoringConfusionMatrixRow.additionalProperties = additionalProperties; + + return deserializedTextAnalysisAuthoringConfusionMatrixRow; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectJobState.java new file mode 100644 index 000000000000..37758661c89b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a copy job. + */ +@Immutable +public final class TextAnalysisAuthoringCopyProjectJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringCopyProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringCopyProjectJobState(OffsetDateTime createdDateTime, OffsetDateTime lastUpdatedDateTime, + JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCopyProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCopyProjectJobState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringCopyProjectJobState. + */ + @Generated + public static TextAnalysisAuthoringCopyProjectJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCopyProjectJobState deserializedTextAnalysisAuthoringCopyProjectJobState + = new TextAnalysisAuthoringCopyProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringCopyProjectJobState.jobId = jobId; + deserializedTextAnalysisAuthoringCopyProjectJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringCopyProjectJobState.warnings = warnings; + deserializedTextAnalysisAuthoringCopyProjectJobState.errors = errors; + + return deserializedTextAnalysisAuthoringCopyProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectOptions.java new file mode 100644 index 000000000000..faf2346b3485 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCopyProjectOptions.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents the options for copying an existing project to another Azure resource. + */ +@Immutable +public final class TextAnalysisAuthoringCopyProjectOptions + implements JsonSerializable { + /* + * Represents the project kind. + */ + @Generated + private final ProjectKind projectKind; + + /* + * The project name to be copied-into. + */ + @Generated + private final String targetProjectName; + + /* + * The access token. + */ + @Generated + private final String accessToken; + + /* + * The expiration of the access token. + */ + @Generated + private final OffsetDateTime expiresAt; + + /* + * Represents the target Azure resource ID. + */ + @Generated + private final String targetResourceId; + + /* + * Represents the target Azure resource region. + */ + @Generated + private final String targetResourceRegion; + + /** + * Creates an instance of TextAnalysisAuthoringCopyProjectOptions class. + * + * @param projectKind the projectKind value to set. + * @param targetProjectName the targetProjectName value to set. + * @param accessToken the accessToken value to set. + * @param expiresAt the expiresAt value to set. + * @param targetResourceId the targetResourceId value to set. + * @param targetResourceRegion the targetResourceRegion value to set. + */ + @Generated + public TextAnalysisAuthoringCopyProjectOptions(ProjectKind projectKind, String targetProjectName, + String accessToken, OffsetDateTime expiresAt, String targetResourceId, String targetResourceRegion) { + this.projectKind = projectKind; + this.targetProjectName = targetProjectName; + this.accessToken = accessToken; + this.expiresAt = expiresAt; + this.targetResourceId = targetResourceId; + this.targetResourceRegion = targetResourceRegion; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the targetProjectName property: The project name to be copied-into. + * + * @return the targetProjectName value. + */ + @Generated + public String getTargetProjectName() { + return this.targetProjectName; + } + + /** + * Get the accessToken property: The access token. + * + * @return the accessToken value. + */ + @Generated + public String getAccessToken() { + return this.accessToken; + } + + /** + * Get the expiresAt property: The expiration of the access token. + * + * @return the expiresAt value. + */ + @Generated + public OffsetDateTime getExpiresAt() { + return this.expiresAt; + } + + /** + * Get the targetResourceId property: Represents the target Azure resource ID. + * + * @return the targetResourceId value. + */ + @Generated + public String getTargetResourceId() { + return this.targetResourceId; + } + + /** + * Get the targetResourceRegion property: Represents the target Azure resource region. + * + * @return the targetResourceRegion value. + */ + @Generated + public String getTargetResourceRegion() { + return this.targetResourceRegion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeStringField("targetProjectName", this.targetProjectName); + jsonWriter.writeStringField("accessToken", this.accessToken); + jsonWriter.writeStringField("expiresAt", + this.expiresAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresAt)); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeStringField("targetResourceRegion", this.targetResourceRegion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCopyProjectOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCopyProjectOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringCopyProjectOptions. + */ + @Generated + public static TextAnalysisAuthoringCopyProjectOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectKind projectKind = null; + String targetProjectName = null; + String accessToken = null; + OffsetDateTime expiresAt = null; + String targetResourceId = null; + String targetResourceRegion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else if ("targetProjectName".equals(fieldName)) { + targetProjectName = reader.getString(); + } else if ("accessToken".equals(fieldName)) { + accessToken = reader.getString(); + } else if ("expiresAt".equals(fieldName)) { + expiresAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("targetResourceId".equals(fieldName)) { + targetResourceId = reader.getString(); + } else if ("targetResourceRegion".equals(fieldName)) { + targetResourceRegion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringCopyProjectOptions(projectKind, targetProjectName, accessToken, expiresAt, + targetResourceId, targetResourceRegion); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateDeploymentOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateDeploymentOptions.java new file mode 100644 index 000000000000..7d9b6278f517 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateDeploymentOptions.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the options for creating or updating a project deployment. + */ +@Fluent +public final class TextAnalysisAuthoringCreateDeploymentOptions + implements JsonSerializable { + /* + * Represents the trained model label. + */ + @Generated + private final String trainedModelLabel; + + /* + * 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. + */ + @Generated + private List assignedResourceIds; + + /** + * Creates an instance of TextAnalysisAuthoringCreateDeploymentOptions class. + * + * @param trainedModelLabel the trainedModelLabel value to set. + */ + @Generated + public TextAnalysisAuthoringCreateDeploymentOptions(String trainedModelLabel) { + this.trainedModelLabel = trainedModelLabel; + } + + /** + * Get the trainedModelLabel property: Represents the trained model label. + * + * @return the trainedModelLabel value. + */ + @Generated + public String getTrainedModelLabel() { + return this.trainedModelLabel; + } + + /** + * Get the assignedResourceIds property: 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. + * + * @return the assignedResourceIds value. + */ + @Generated + public List getAssignedResourceIds() { + return this.assignedResourceIds; + } + + /** + * Set the assignedResourceIds property: 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. + * + * @param assignedResourceIds the assignedResourceIds value to set. + * @return the TextAnalysisAuthoringCreateDeploymentOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateDeploymentOptions setAssignedResourceIds(List assignedResourceIds) { + this.assignedResourceIds = assignedResourceIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("trainedModelLabel", this.trainedModelLabel); + jsonWriter.writeArrayField("assignedResourceIds", this.assignedResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCreateDeploymentOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCreateDeploymentOptions if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringCreateDeploymentOptions. + */ + @Generated + public static TextAnalysisAuthoringCreateDeploymentOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String trainedModelLabel = null; + List assignedResourceIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainedModelLabel".equals(fieldName)) { + trainedModelLabel = reader.getString(); + } else if ("assignedResourceIds".equals(fieldName)) { + assignedResourceIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCreateDeploymentOptions deserializedTextAnalysisAuthoringCreateDeploymentOptions + = new TextAnalysisAuthoringCreateDeploymentOptions(trainedModelLabel); + deserializedTextAnalysisAuthoringCreateDeploymentOptions.assignedResourceIds = assignedResourceIds; + + return deserializedTextAnalysisAuthoringCreateDeploymentOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateProjectOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateProjectOptions.java new file mode 100644 index 000000000000..7015bc01642c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCreateProjectOptions.java @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.ai.language.text.authoring.implementation.JsonMergePatchHelper; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Represents the options used to create or update a project. + */ +@Fluent +public final class TextAnalysisAuthoringCreateProjectOptions + implements JsonSerializable { + /* + * The project kind. + */ + @Generated + private ProjectKind projectKind; + + /* + * The storage container name. + */ + @Generated + private String storageInputContainerName; + + /* + * The project settings. + */ + @Generated + private ProjectSettings settings; + + /* + * The new project name. + */ + @Generated + private String projectName; + + /* + * Whether the project would be used for multiple languages or not. + */ + @Generated + private Boolean multilingual; + + /* + * The project description. + */ + @Generated + private String 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. + */ + @Generated + private String language; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTextAnalysisAuthoringCreateProjectOptionsAccessor( + new JsonMergePatchHelper.TextAnalysisAuthoringCreateProjectOptionsAccessor() { + @Override + public TextAnalysisAuthoringCreateProjectOptions prepareModelForJsonMergePatch( + TextAnalysisAuthoringCreateProjectOptions model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TextAnalysisAuthoringCreateProjectOptions model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TextAnalysisAuthoringCreateProjectOptions class. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions() { + } + + /** + * Get the projectKind property: The project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Set the projectKind property: The project kind. + *

Required when create the resource.

+ * + * @param projectKind the projectKind value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setProjectKind(ProjectKind projectKind) { + this.projectKind = projectKind; + this.updatedProperties.add("projectKind"); + return this; + } + + /** + * Get the storageInputContainerName property: The storage container name. + * + * @return the storageInputContainerName value. + */ + @Generated + public String getStorageInputContainerName() { + return this.storageInputContainerName; + } + + /** + * Set the storageInputContainerName property: The storage container name. + *

Required when create the resource.

+ * + * @param storageInputContainerName the storageInputContainerName value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setStorageInputContainerName(String storageInputContainerName) { + this.storageInputContainerName = storageInputContainerName; + this.updatedProperties.add("storageInputContainerName"); + return this; + } + + /** + * Get the settings property: The project settings. + * + * @return the settings value. + */ + @Generated + public ProjectSettings getSettings() { + return this.settings; + } + + /** + * Set the settings property: The project settings. + * + * @param settings the settings value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setSettings(ProjectSettings settings) { + this.settings = settings; + this.updatedProperties.add("settings"); + return this; + } + + /** + * Get the projectName property: The new project name. + * + * @return the projectName value. + */ + @Generated + public String getProjectName() { + return this.projectName; + } + + /** + * Set the projectName property: The new project name. + *

Required when create the resource.

+ * + * @param projectName the projectName value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setProjectName(String projectName) { + this.projectName = projectName; + this.updatedProperties.add("projectName"); + return this; + } + + /** + * Get the multilingual property: Whether the project would be used for multiple languages or not. + * + * @return the multilingual value. + */ + @Generated + public Boolean isMultilingual() { + return this.multilingual; + } + + /** + * Set the multilingual property: Whether the project would be used for multiple languages or not. + * + * @param multilingual the multilingual value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setMultilingual(Boolean multilingual) { + this.multilingual = multilingual; + this.updatedProperties.add("multilingual"); + return this; + } + + /** + * Get the description property: The project description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The project description. + * + * @param description the description value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + *

Required when create the resource.

+ * + * @param language the language value to set. + * @return the TextAnalysisAuthoringCreateProjectOptions object itself. + */ + @Generated + public TextAnalysisAuthoringCreateProjectOptions setLanguage(String language) { + this.language = language; + this.updatedProperties.add("language"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + jsonWriter.writeJsonField("settings", this.settings); + jsonWriter.writeStringField("projectName", this.projectName); + jsonWriter.writeBooleanField("multilingual", this.multilingual); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("language", this.language); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("projectKind")) { + if (this.projectKind == null) { + jsonWriter.writeNullField("projectKind"); + } else { + jsonWriter.writeStringField("projectKind", this.projectKind.toString()); + } + } + if (updatedProperties.contains("storageInputContainerName")) { + if (this.storageInputContainerName == null) { + jsonWriter.writeNullField("storageInputContainerName"); + } else { + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + } + } + if (updatedProperties.contains("settings")) { + if (this.settings == null) { + jsonWriter.writeNullField("settings"); + } else { + JsonMergePatchHelper.getProjectSettingsAccessor().prepareModelForJsonMergePatch(this.settings, true); + jsonWriter.writeJsonField("settings", this.settings); + JsonMergePatchHelper.getProjectSettingsAccessor().prepareModelForJsonMergePatch(this.settings, false); + } + } + if (updatedProperties.contains("projectName")) { + if (this.projectName == null) { + jsonWriter.writeNullField("projectName"); + } else { + jsonWriter.writeStringField("projectName", this.projectName); + } + } + if (updatedProperties.contains("multilingual")) { + if (this.multilingual == null) { + jsonWriter.writeNullField("multilingual"); + } else { + jsonWriter.writeBooleanField("multilingual", this.multilingual); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("language")) { + if (this.language == null) { + jsonWriter.writeNullField("language"); + } else { + jsonWriter.writeStringField("language", this.language); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCreateProjectOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCreateProjectOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringCreateProjectOptions. + */ + @Generated + public static TextAnalysisAuthoringCreateProjectOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringCreateProjectOptions deserializedTextAnalysisAuthoringCreateProjectOptions + = new TextAnalysisAuthoringCreateProjectOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("storageInputContainerName".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.storageInputContainerName + = reader.getString(); + } else if ("settings".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.settings = ProjectSettings.fromJson(reader); + } else if ("projectName".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.projectName = reader.getString(); + } else if ("multilingual".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.multilingual + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.description = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringCreateProjectOptions.language = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringCreateProjectOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult.java new file mode 100644 index 000000000000..907722418d62 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the document evaluation result for a custom entity recognition project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult + extends TextAnalysisAuthoringDocumentEvaluationResult { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_ENTITY_RECOGNITION; + + /* + * Represents the evaluation prediction for entity recognition. + */ + @Generated + private final TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult customEntityRecognitionResult; + + /** + * Creates an instance of TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + * @param customEntityRecognitionResult the customEntityRecognitionResult value to set. + */ + @Generated + private TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult(String location, String language, + TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) { + super(location, language); + this.customEntityRecognitionResult = customEntityRecognitionResult; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customEntityRecognitionResult property: Represents the evaluation prediction for entity recognition. + * + * @return the customEntityRecognitionResult value. + */ + @Generated + public TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult getCustomEntityRecognitionResult() { + return this.customEntityRecognitionResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", getLocation()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("customEntityRecognitionResult", this.customEntityRecognitionResult); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null; + ProjectKind projectKind = ProjectKind.CUSTOM_ENTITY_RECOGNITION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("customEntityRecognitionResult".equals(fieldName)) { + customEntityRecognitionResult + = TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult deserializedTextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult + = new TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult(location, language, + customEntityRecognitionResult); + deserializedTextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary.java new file mode 100644 index 000000000000..01269e98a3cd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom entity recognition project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary + extends TextAnalysisAuthoringEvaluationSummary { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_ENTITY_RECOGNITION; + + /* + * Contains the data related to extraction evaluation. + */ + @Generated + private final TextAnalysisAuthoringEntityRecognitionEvaluationSummary customEntityRecognitionEvaluation; + + /** + * Creates an instance of TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param customEntityRecognitionEvaluation the customEntityRecognitionEvaluation value to set. + */ + @Generated + private TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary( + TextAnalysisAuthoringEvaluationOptions evaluationOptions, + TextAnalysisAuthoringEntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) { + super(evaluationOptions); + this.customEntityRecognitionEvaluation = customEntityRecognitionEvaluation; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customEntityRecognitionEvaluation property: Contains the data related to extraction evaluation. + * + * @return the customEntityRecognitionEvaluation value. + */ + @Generated + public TextAnalysisAuthoringEntityRecognitionEvaluationSummary getCustomEntityRecognitionEvaluation() { + return this.customEntityRecognitionEvaluation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", getEvaluationOptions()); + jsonWriter.writeJsonField("customEntityRecognitionEvaluation", this.customEntityRecognitionEvaluation); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + TextAnalysisAuthoringEntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null; + ProjectKind projectKind = ProjectKind.CUSTOM_ENTITY_RECOGNITION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("customEntityRecognitionEvaluation".equals(fieldName)) { + customEntityRecognitionEvaluation + = TextAnalysisAuthoringEntityRecognitionEvaluationSummary.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary deserializedTextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary + = new TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary(evaluationOptions, + customEntityRecognitionEvaluation); + deserializedTextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult.java new file mode 100644 index 000000000000..817d70faaa40 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the document evaluation result for a custom entity recognition project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult + extends TextAnalysisAuthoringDocumentEvaluationResult { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_HEALTHCARE; + + /* + * Represents the evaluation prediction for entity recognition. + */ + @Generated + private final TextAnalysisAuthoringDocumentHealthcareEvaluationResult customHealthcareResult; + + /** + * Creates an instance of TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + * @param customHealthcareResult the customHealthcareResult value to set. + */ + @Generated + private TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult(String location, String language, + TextAnalysisAuthoringDocumentHealthcareEvaluationResult customHealthcareResult) { + super(location, language); + this.customHealthcareResult = customHealthcareResult; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customHealthcareResult property: Represents the evaluation prediction for entity recognition. + * + * @return the customHealthcareResult value. + */ + @Generated + public TextAnalysisAuthoringDocumentHealthcareEvaluationResult getCustomHealthcareResult() { + return this.customHealthcareResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", getLocation()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("customHealthcareResult", this.customHealthcareResult); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + TextAnalysisAuthoringDocumentHealthcareEvaluationResult customHealthcareResult = null; + ProjectKind projectKind = ProjectKind.CUSTOM_HEALTHCARE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("customHealthcareResult".equals(fieldName)) { + customHealthcareResult = TextAnalysisAuthoringDocumentHealthcareEvaluationResult.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult deserializedTextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult + = new TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult(location, language, + customHealthcareResult); + deserializedTextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareEvaluationSummary.java new file mode 100644 index 000000000000..7d51fc154607 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomHealthcareEvaluationSummary.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom health care project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomHealthcareEvaluationSummary + extends TextAnalysisAuthoringEvaluationSummary { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_HEALTHCARE; + + /* + * Contains the data related to health care evaluation. + */ + @Generated + private final TextAnalysisAuthoringEntityRecognitionEvaluationSummary customHealthcareEvaluation; + + /** + * Creates an instance of TextAnalysisAuthoringCustomHealthcareEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param customHealthcareEvaluation the customHealthcareEvaluation value to set. + */ + @Generated + private TextAnalysisAuthoringCustomHealthcareEvaluationSummary( + TextAnalysisAuthoringEvaluationOptions evaluationOptions, + TextAnalysisAuthoringEntityRecognitionEvaluationSummary customHealthcareEvaluation) { + super(evaluationOptions); + this.customHealthcareEvaluation = customHealthcareEvaluation; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customHealthcareEvaluation property: Contains the data related to health care evaluation. + * + * @return the customHealthcareEvaluation value. + */ + @Generated + public TextAnalysisAuthoringEntityRecognitionEvaluationSummary getCustomHealthcareEvaluation() { + return this.customHealthcareEvaluation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", getEvaluationOptions()); + jsonWriter.writeJsonField("customHealthcareEvaluation", this.customHealthcareEvaluation); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomHealthcareEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomHealthcareEvaluationSummary if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringCustomHealthcareEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringCustomHealthcareEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + TextAnalysisAuthoringEntityRecognitionEvaluationSummary customHealthcareEvaluation = null; + ProjectKind projectKind = ProjectKind.CUSTOM_HEALTHCARE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("customHealthcareEvaluation".equals(fieldName)) { + customHealthcareEvaluation + = TextAnalysisAuthoringEntityRecognitionEvaluationSummary.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomHealthcareEvaluationSummary deserializedTextAnalysisAuthoringCustomHealthcareEvaluationSummary + = new TextAnalysisAuthoringCustomHealthcareEvaluationSummary(evaluationOptions, + customHealthcareEvaluation); + deserializedTextAnalysisAuthoringCustomHealthcareEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomHealthcareEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult.java new file mode 100644 index 000000000000..e450ae6576df --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the document evaluation result for a custom multi-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult + extends TextAnalysisAuthoringDocumentEvaluationResult { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_MULTI_LABEL_CLASSIFICATION; + + /* + * Represents the evaluation prediction for multi label classification. + */ + @Generated + private final TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult; + + /** + * Creates an instance of TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + * @param customMultiLabelClassificationResult the customMultiLabelClassificationResult value to set. + */ + @Generated + private TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult(String location, + String language, + TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) { + super(location, language); + this.customMultiLabelClassificationResult = customMultiLabelClassificationResult; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customMultiLabelClassificationResult property: Represents the evaluation prediction for multi label + * classification. + * + * @return the customMultiLabelClassificationResult value. + */ + @Generated + public TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult + getCustomMultiLabelClassificationResult() { + return this.customMultiLabelClassificationResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", getLocation()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("customMultiLabelClassificationResult", this.customMultiLabelClassificationResult); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult + = null; + ProjectKind projectKind = ProjectKind.CUSTOM_MULTI_LABEL_CLASSIFICATION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("customMultiLabelClassificationResult".equals(fieldName)) { + customMultiLabelClassificationResult + = TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult deserializedTextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult + = new TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult(location, language, + customMultiLabelClassificationResult); + deserializedTextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult.projectKind + = projectKind; + + return deserializedTextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary.java new file mode 100644 index 000000000000..17ad2b7bd14a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom multi-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary + extends TextAnalysisAuthoringEvaluationSummary { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_MULTI_LABEL_CLASSIFICATION; + + /* + * Contains the data related to multi label classification evaluation. + */ + @Generated + private final TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation; + + /** + * Creates an instance of TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param customMultiLabelClassificationEvaluation the customMultiLabelClassificationEvaluation value to set. + */ + @Generated + private TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary( + TextAnalysisAuthoringEvaluationOptions evaluationOptions, + TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) { + super(evaluationOptions); + this.customMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customMultiLabelClassificationEvaluation property: Contains the data related to multi label + * classification evaluation. + * + * @return the customMultiLabelClassificationEvaluation value. + */ + @Generated + public TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary + getCustomMultiLabelClassificationEvaluation() { + return this.customMultiLabelClassificationEvaluation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", getEvaluationOptions()); + jsonWriter.writeJsonField("customMultiLabelClassificationEvaluation", + this.customMultiLabelClassificationEvaluation); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation + = null; + ProjectKind projectKind = ProjectKind.CUSTOM_MULTI_LABEL_CLASSIFICATION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("customMultiLabelClassificationEvaluation".equals(fieldName)) { + customMultiLabelClassificationEvaluation + = TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary deserializedTextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary + = new TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary(evaluationOptions, + customMultiLabelClassificationEvaluation); + deserializedTextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult.java new file mode 100644 index 000000000000..2b42ec91a853 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the document evaluation result for a custom single-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult + extends TextAnalysisAuthoringDocumentEvaluationResult { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_SINGLE_LABEL_CLASSIFICATION; + + /* + * Represents the evaluation prediction for single label classification. + */ + @Generated + private final TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult; + + /** + * Creates an instance of TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + * @param customSingleLabelClassificationResult the customSingleLabelClassificationResult value to set. + */ + @Generated + private TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult(String location, + String language, + TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) { + super(location, language); + this.customSingleLabelClassificationResult = customSingleLabelClassificationResult; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customSingleLabelClassificationResult property: Represents the evaluation prediction for single label + * classification. + * + * @return the customSingleLabelClassificationResult value. + */ + @Generated + public TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult + getCustomSingleLabelClassificationResult() { + return this.customSingleLabelClassificationResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", getLocation()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("customSingleLabelClassificationResult", this.customSingleLabelClassificationResult); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult + = null; + ProjectKind projectKind = ProjectKind.CUSTOM_SINGLE_LABEL_CLASSIFICATION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("customSingleLabelClassificationResult".equals(fieldName)) { + customSingleLabelClassificationResult + = TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult deserializedTextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult + = new TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult(location, language, + customSingleLabelClassificationResult); + deserializedTextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult.projectKind + = projectKind; + + return deserializedTextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary.java new file mode 100644 index 000000000000..e058572abc10 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom single-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary + extends TextAnalysisAuthoringEvaluationSummary { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_SINGLE_LABEL_CLASSIFICATION; + + /* + * Contains the data related to single label classification evaluation. + */ + @Generated + private final TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation; + + /** + * Creates an instance of TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param customSingleLabelClassificationEvaluation the customSingleLabelClassificationEvaluation value to set. + */ + @Generated + private TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary( + TextAnalysisAuthoringEvaluationOptions evaluationOptions, + TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) { + super(evaluationOptions); + this.customSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customSingleLabelClassificationEvaluation property: Contains the data related to single label + * classification evaluation. + * + * @return the customSingleLabelClassificationEvaluation value. + */ + @Generated + public TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary + getCustomSingleLabelClassificationEvaluation() { + return this.customSingleLabelClassificationEvaluation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", getEvaluationOptions()); + jsonWriter.writeJsonField("customSingleLabelClassificationEvaluation", + this.customSingleLabelClassificationEvaluation); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary if the JsonReader + * was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation + = null; + ProjectKind projectKind = ProjectKind.CUSTOM_SINGLE_LABEL_CLASSIFICATION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("customSingleLabelClassificationEvaluation".equals(fieldName)) { + customSingleLabelClassificationEvaluation + = TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary deserializedTextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary + = new TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary(evaluationOptions, + customSingleLabelClassificationEvaluation); + deserializedTextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult.java new file mode 100644 index 000000000000..62951a497fb9 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the document evaluation result for a custom sentiment project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult + extends TextAnalysisAuthoringDocumentEvaluationResult { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_TEXT_SENTIMENT; + + /* + * Represents the evaluation prediction for text sentiment. + */ + @Generated + private final TextAnalysisAuthoringDocumentTextSentimentEvaluationResult customTextSentimentResult; + + /** + * Creates an instance of TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + * @param customTextSentimentResult the customTextSentimentResult value to set. + */ + @Generated + private TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult(String location, String language, + TextAnalysisAuthoringDocumentTextSentimentEvaluationResult customTextSentimentResult) { + super(location, language); + this.customTextSentimentResult = customTextSentimentResult; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customTextSentimentResult property: Represents the evaluation prediction for text sentiment. + * + * @return the customTextSentimentResult value. + */ + @Generated + public TextAnalysisAuthoringDocumentTextSentimentEvaluationResult getCustomTextSentimentResult() { + return this.customTextSentimentResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", getLocation()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("customTextSentimentResult", this.customTextSentimentResult); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + TextAnalysisAuthoringDocumentTextSentimentEvaluationResult customTextSentimentResult = null; + ProjectKind projectKind = ProjectKind.CUSTOM_TEXT_SENTIMENT; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("customTextSentimentResult".equals(fieldName)) { + customTextSentimentResult + = TextAnalysisAuthoringDocumentTextSentimentEvaluationResult.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult deserializedTextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult + = new TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult(location, language, + customTextSentimentResult); + deserializedTextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentEvaluationSummary.java new file mode 100644 index 000000000000..9f684a519f0c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringCustomTextSentimentEvaluationSummary.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom text sentiment project. + */ +@Immutable +public final class TextAnalysisAuthoringCustomTextSentimentEvaluationSummary + extends TextAnalysisAuthoringEvaluationSummary { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_TEXT_SENTIMENT; + + /* + * Contains the data related to custom sentiment evaluation. + */ + @Generated + private final TextAnalysisAuthoringTextSentimentEvaluationSummary customTextSentimentEvaluation; + + /** + * Creates an instance of TextAnalysisAuthoringCustomTextSentimentEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param customTextSentimentEvaluation the customTextSentimentEvaluation value to set. + */ + @Generated + private TextAnalysisAuthoringCustomTextSentimentEvaluationSummary( + TextAnalysisAuthoringEvaluationOptions evaluationOptions, + TextAnalysisAuthoringTextSentimentEvaluationSummary customTextSentimentEvaluation) { + super(evaluationOptions); + this.customTextSentimentEvaluation = customTextSentimentEvaluation; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the customTextSentimentEvaluation property: Contains the data related to custom sentiment evaluation. + * + * @return the customTextSentimentEvaluation value. + */ + @Generated + public TextAnalysisAuthoringTextSentimentEvaluationSummary getCustomTextSentimentEvaluation() { + return this.customTextSentimentEvaluation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", getEvaluationOptions()); + jsonWriter.writeJsonField("customTextSentimentEvaluation", this.customTextSentimentEvaluation); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringCustomTextSentimentEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringCustomTextSentimentEvaluationSummary if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringCustomTextSentimentEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringCustomTextSentimentEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + TextAnalysisAuthoringTextSentimentEvaluationSummary customTextSentimentEvaluation = null; + ProjectKind projectKind = ProjectKind.CUSTOM_TEXT_SENTIMENT; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("customTextSentimentEvaluation".equals(fieldName)) { + customTextSentimentEvaluation + = TextAnalysisAuthoringTextSentimentEvaluationSummary.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringCustomTextSentimentEvaluationSummary deserializedTextAnalysisAuthoringCustomTextSentimentEvaluationSummary + = new TextAnalysisAuthoringCustomTextSentimentEvaluationSummary(evaluationOptions, + customTextSentimentEvaluation); + deserializedTextAnalysisAuthoringCustomTextSentimentEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringCustomTextSentimentEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeleteDeploymentOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeleteDeploymentOptions.java new file mode 100644 index 000000000000..eede6c46e8e8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeleteDeploymentOptions.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the options for deleting a project deployment. + */ +@Fluent +public final class TextAnalysisAuthoringDeleteDeploymentOptions + implements JsonSerializable { + /* + * 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. + */ + @Generated + private List assignedResourceIds; + + /** + * Creates an instance of TextAnalysisAuthoringDeleteDeploymentOptions class. + */ + @Generated + public TextAnalysisAuthoringDeleteDeploymentOptions() { + } + + /** + * Get the assignedResourceIds property: 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. + * + * @return the assignedResourceIds value. + */ + @Generated + public List getAssignedResourceIds() { + return this.assignedResourceIds; + } + + /** + * Set the assignedResourceIds property: 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. + * + * @param assignedResourceIds the assignedResourceIds value to set. + * @return the TextAnalysisAuthoringDeleteDeploymentOptions object itself. + */ + @Generated + public TextAnalysisAuthoringDeleteDeploymentOptions setAssignedResourceIds(List assignedResourceIds) { + this.assignedResourceIds = assignedResourceIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assignedResourceIds", this.assignedResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDeleteDeploymentOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDeleteDeploymentOptions if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringDeleteDeploymentOptions. + */ + @Generated + public static TextAnalysisAuthoringDeleteDeploymentOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringDeleteDeploymentOptions deserializedTextAnalysisAuthoringDeleteDeploymentOptions + = new TextAnalysisAuthoringDeleteDeploymentOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedResourceIds".equals(fieldName)) { + List assignedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTextAnalysisAuthoringDeleteDeploymentOptions.assignedResourceIds = assignedResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringDeleteDeploymentOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.java new file mode 100644 index 000000000000..bd4f7f8d18c1 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of an existing delete deployment from specific resources job. + */ +@Immutable +public final class TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState. + */ + @Generated + public static TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState + = new TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState(createdDateTime, lastUpdatedDateTime, + status); + deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.jobId = jobId; + deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.expirationDateTime + = expirationDateTime; + deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.warnings = warnings; + deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState.errors = errors; + + return deserializedTextAnalysisAuthoringDeploymentDeleteFromResourcesJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentJobState.java new file mode 100644 index 000000000000..ed656141169f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a deployment job. + */ +@Immutable +public final class TextAnalysisAuthoringDeploymentJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringDeploymentJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringDeploymentJobState(OffsetDateTime createdDateTime, OffsetDateTime lastUpdatedDateTime, + JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDeploymentJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDeploymentJobState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringDeploymentJobState. + */ + @Generated + public static TextAnalysisAuthoringDeploymentJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringDeploymentJobState deserializedTextAnalysisAuthoringDeploymentJobState + = new TextAnalysisAuthoringDeploymentJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringDeploymentJobState.jobId = jobId; + deserializedTextAnalysisAuthoringDeploymentJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringDeploymentJobState.warnings = warnings; + deserializedTextAnalysisAuthoringDeploymentJobState.errors = errors; + + return deserializedTextAnalysisAuthoringDeploymentJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentResource.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentResource.java new file mode 100644 index 000000000000..edebbffdc34a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDeploymentResource.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an Azure resource assigned to a deployment. + */ +@Immutable +public final class TextAnalysisAuthoringDeploymentResource + implements JsonSerializable { + /* + * Represents the Azure resource Id. + */ + @Generated + private final String resourceId; + + /* + * Represents the resource region. + */ + @Generated + private final String region; + + /** + * Creates an instance of TextAnalysisAuthoringDeploymentResource class. + * + * @param resourceId the resourceId value to set. + * @param region the region value to set. + */ + @Generated + private TextAnalysisAuthoringDeploymentResource(String resourceId, String region) { + this.resourceId = resourceId; + this.region = region; + } + + /** + * Get the resourceId property: Represents the Azure resource Id. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the region property: Represents the resource region. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDeploymentResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDeploymentResource if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringDeploymentResource. + */ + @Generated + public static TextAnalysisAuthoringDeploymentResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String resourceId = null; + String region = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + resourceId = reader.getString(); + } else if ("region".equals(fieldName)) { + region = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDeploymentResource(resourceId, region); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityLabelEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityLabelEvaluationResult.java new file mode 100644 index 000000000000..d82d54430e0e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityLabelEvaluationResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an evaluation result entity label. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentEntityLabelEvaluationResult + implements JsonSerializable { + /* + * Represents the entity category. + */ + @Generated + private final String category; + + /* + * Represents the entity offset index relative to the original text. + */ + @Generated + private final int offset; + + /* + * Represents the entity length. + */ + @Generated + private final int length; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentEntityLabelEvaluationResult class. + * + * @param category the category value to set. + * @param offset the offset value to set. + * @param length the length value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentEntityLabelEvaluationResult(String category, int offset, int length) { + this.category = category; + this.offset = offset; + this.length = length; + } + + /** + * Get the category property: Represents the entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Get the offset property: Represents the entity offset index relative to the original text. + * + * @return the offset value. + */ + @Generated + public int getOffset() { + return this.offset; + } + + /** + * Get the length property: Represents the entity length. + * + * @return the length value. + */ + @Generated + public int getLength() { + return this.length; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeIntField("offset", this.offset); + jsonWriter.writeIntField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentEntityLabelEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentEntityLabelEvaluationResult if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentEntityLabelEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentEntityLabelEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String category = null; + int offset = 0; + int length = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = reader.getString(); + } else if ("offset".equals(fieldName)) { + offset = reader.getInt(); + } else if ("length".equals(fieldName)) { + length = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentEntityLabelEvaluationResult(category, offset, length); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult.java new file mode 100644 index 000000000000..1079f37224be --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the entity recognition evaluation result for a document. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult + implements JsonSerializable { + /* + * Represents the document labelled entities. + */ + @Generated + private final List entities; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult class. + * + * @param entities the entities value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult( + List entities) { + this.entities = entities; + } + + /** + * Get the entities property: Represents the document labelled entities. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List entities = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + entities = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentEntityRegionEvaluationResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult(entities); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRegionEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRegionEvaluationResult.java new file mode 100644 index 000000000000..63701723d686 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEntityRegionEvaluationResult.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the evaluation comparison between the expected and predicted entities of a document region. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentEntityRegionEvaluationResult + implements JsonSerializable { + /* + * Represents the region's expected entity labels. + */ + @Generated + private final List expectedEntities; + + /* + * Represents the region's predicted entity labels. + */ + @Generated + private final List predictedEntities; + + /* + * Represents the region offset. + */ + @Generated + private final int regionOffset; + + /* + * Represents the region length. + */ + @Generated + private final int regionLength; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentEntityRegionEvaluationResult class. + * + * @param expectedEntities the expectedEntities value to set. + * @param predictedEntities the predictedEntities value to set. + * @param regionOffset the regionOffset value to set. + * @param regionLength the regionLength value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentEntityRegionEvaluationResult( + List expectedEntities, + List predictedEntities, int regionOffset, + int regionLength) { + this.expectedEntities = expectedEntities; + this.predictedEntities = predictedEntities; + this.regionOffset = regionOffset; + this.regionLength = regionLength; + } + + /** + * Get the expectedEntities property: Represents the region's expected entity labels. + * + * @return the expectedEntities value. + */ + @Generated + public List getExpectedEntities() { + return this.expectedEntities; + } + + /** + * Get the predictedEntities property: Represents the region's predicted entity labels. + * + * @return the predictedEntities value. + */ + @Generated + public List getPredictedEntities() { + return this.predictedEntities; + } + + /** + * Get the regionOffset property: Represents the region offset. + * + * @return the regionOffset value. + */ + @Generated + public int getRegionOffset() { + return this.regionOffset; + } + + /** + * Get the regionLength property: Represents the region length. + * + * @return the regionLength value. + */ + @Generated + public int getRegionLength() { + return this.regionLength; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("expectedEntities", this.expectedEntities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("predictedEntities", this.predictedEntities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeIntField("regionOffset", this.regionOffset); + jsonWriter.writeIntField("regionLength", this.regionLength); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentEntityRegionEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentEntityRegionEvaluationResult if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentEntityRegionEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentEntityRegionEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List expectedEntities = null; + List predictedEntities = null; + int regionOffset = 0; + int regionLength = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedEntities".equals(fieldName)) { + expectedEntities = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentEntityLabelEvaluationResult.fromJson(reader1)); + } else if ("predictedEntities".equals(fieldName)) { + predictedEntities = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentEntityLabelEvaluationResult.fromJson(reader1)); + } else if ("regionOffset".equals(fieldName)) { + regionOffset = reader.getInt(); + } else if ("regionLength".equals(fieldName)) { + regionLength = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentEntityRegionEvaluationResult(expectedEntities, predictedEntities, + regionOffset, regionLength); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEvaluationResult.java new file mode 100644 index 000000000000..410e8fe31628 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentEvaluationResult.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation result of a document. + */ +@Immutable +public class TextAnalysisAuthoringDocumentEvaluationResult + implements JsonSerializable { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind = ProjectKind.fromString("TextAnalysisAuthoringDocumentEvaluationResult"); + + /* + * Represents the document path. + */ + @Generated + private final 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. + */ + @Generated + private final String language; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentEvaluationResult class. + * + * @param location the location value to set. + * @param language the language value to set. + */ + @Generated + protected TextAnalysisAuthoringDocumentEvaluationResult(String location, String language) { + this.location = location; + this.language = language; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the location property: Represents the document path. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentEvaluationResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringDocumentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentEvaluationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("projectKind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CustomEntityRecognition".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult + .fromJson(readerToUse.reset()); + } else if ("CustomHealthcare".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult.fromJson(readerToUse.reset()); + } else if ("CustomMultiLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult + .fromJson(readerToUse.reset()); + } else if ("CustomSingleLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult + .fromJson(readerToUse.reset()); + } else if ("CustomTextSentiment".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult + .fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static TextAnalysisAuthoringDocumentEvaluationResult fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String location = null; + String language = null; + ProjectKind projectKind = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringDocumentEvaluationResult deserializedTextAnalysisAuthoringDocumentEvaluationResult + = new TextAnalysisAuthoringDocumentEvaluationResult(location, language); + deserializedTextAnalysisAuthoringDocumentEvaluationResult.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringDocumentEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentHealthcareEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentHealthcareEvaluationResult.java new file mode 100644 index 000000000000..e7788780e629 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentHealthcareEvaluationResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the healthcare evaluation result for a document. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentHealthcareEvaluationResult + implements JsonSerializable { + /* + * Represents the document labelled entities. + */ + @Generated + private final List entities; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentHealthcareEvaluationResult class. + * + * @param entities the entities value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentHealthcareEvaluationResult( + List entities) { + this.entities = entities; + } + + /** + * Get the entities property: Represents the document labelled entities. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentHealthcareEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentHealthcareEvaluationResult if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringDocumentHealthcareEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentHealthcareEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List entities = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + entities = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentEntityRegionEvaluationResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentHealthcareEvaluationResult(entities); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult.java new file mode 100644 index 000000000000..7f45f0b28462 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the comparison between the expected and predicted classes that are result from the evaluation operation. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult + implements JsonSerializable { + /* + * Represents the document's expected classes. + */ + @Generated + private final List expectedClasses; + + /* + * Represents the document's predicted classes. + */ + @Generated + private final List predictedClasses; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult class. + * + * @param expectedClasses the expectedClasses value to set. + * @param predictedClasses the predictedClasses value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult(List expectedClasses, + List predictedClasses) { + this.expectedClasses = expectedClasses; + this.predictedClasses = predictedClasses; + } + + /** + * Get the expectedClasses property: Represents the document's expected classes. + * + * @return the expectedClasses value. + */ + @Generated + public List getExpectedClasses() { + return this.expectedClasses; + } + + /** + * Get the predictedClasses property: Represents the document's predicted classes. + * + * @return the predictedClasses value. + */ + @Generated + public List getPredictedClasses() { + return this.predictedClasses; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("expectedClasses", this.expectedClasses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("predictedClasses", this.predictedClasses, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult if the JsonReader + * was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List expectedClasses = null; + List predictedClasses = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedClasses".equals(fieldName)) { + expectedClasses = reader.readArray(reader1 -> reader1.getString()); + } else if ("predictedClasses".equals(fieldName)) { + predictedClasses = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult(expectedClasses, + predictedClasses); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult.java new file mode 100644 index 000000000000..35df8cb360fc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an evaluation result Sentiment label. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult + implements JsonSerializable { + /* + * Represents the sentiment category. + */ + @Generated + private final Sentiment category; + + /* + * Represents the sentiment offset index relative to the original text. + */ + @Generated + private final int offset; + + /* + * Represents the sentiment length. + */ + @Generated + private final int length; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult class. + * + * @param category the category value to set. + * @param offset the offset value to set. + * @param length the length value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult(Sentiment category, int offset, int length) { + this.category = category; + this.offset = offset; + this.length = length; + } + + /** + * Get the category property: Represents the sentiment category. + * + * @return the category value. + */ + @Generated + public Sentiment getCategory() { + return this.category; + } + + /** + * Get the offset property: Represents the sentiment offset index relative to the original text. + * + * @return the offset value. + */ + @Generated + public int getOffset() { + return this.offset; + } + + /** + * Get the length property: Represents the sentiment length. + * + * @return the length value. + */ + @Generated + public int getLength() { + return this.length; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeIntField("offset", this.offset); + jsonWriter.writeIntField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + Sentiment category = null; + int offset = 0; + int length = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = Sentiment.fromString(reader.getString()); + } else if ("offset".equals(fieldName)) { + offset = reader.getInt(); + } else if ("length".equals(fieldName)) { + length = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult(category, offset, length); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult.java new file mode 100644 index 000000000000..19a2f6bc9f13 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the comparison between the expected and predicted class that result from an evaluation operation. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult + implements JsonSerializable { + /* + * Represents the document's expected class. + */ + @Generated + private final String expectedClass; + + /* + * Represents the document's predicted class. + */ + @Generated + private final String predictedClass; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult class. + * + * @param expectedClass the expectedClass value to set. + * @param predictedClass the predictedClass value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult(String expectedClass, + String predictedClass) { + this.expectedClass = expectedClass; + this.predictedClass = predictedClass; + } + + /** + * Get the expectedClass property: Represents the document's expected class. + * + * @return the expectedClass value. + */ + @Generated + public String getExpectedClass() { + return this.expectedClass; + } + + /** + * Get the predictedClass property: Represents the document's predicted class. + * + * @return the predictedClass value. + */ + @Generated + public String getPredictedClass() { + return this.predictedClass; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expectedClass", this.expectedClass); + jsonWriter.writeStringField("predictedClass", this.predictedClass); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult if the JsonReader + * was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String expectedClass = null; + String predictedClass = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedClass".equals(fieldName)) { + expectedClass = reader.getString(); + } else if ("predictedClass".equals(fieldName)) { + predictedClass = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult(expectedClass, + predictedClass); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentTextSentimentEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentTextSentimentEvaluationResult.java new file mode 100644 index 000000000000..16e9b6c16ce4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringDocumentTextSentimentEvaluationResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the comparison between the expected and predicted sentiment that result from an evaluation operation. + */ +@Immutable +public final class TextAnalysisAuthoringDocumentTextSentimentEvaluationResult + implements JsonSerializable { + /* + * Represents the document's expected sentiment labels. + */ + @Generated + private final List expectedSentimentSpans; + + /* + * Represents the document's predicted sentiment labels. + */ + @Generated + private final List predictedSentimentSpans; + + /** + * Creates an instance of TextAnalysisAuthoringDocumentTextSentimentEvaluationResult class. + * + * @param expectedSentimentSpans the expectedSentimentSpans value to set. + * @param predictedSentimentSpans the predictedSentimentSpans value to set. + */ + @Generated + private TextAnalysisAuthoringDocumentTextSentimentEvaluationResult( + List expectedSentimentSpans, + List predictedSentimentSpans) { + this.expectedSentimentSpans = expectedSentimentSpans; + this.predictedSentimentSpans = predictedSentimentSpans; + } + + /** + * Get the expectedSentimentSpans property: Represents the document's expected sentiment labels. + * + * @return the expectedSentimentSpans value. + */ + @Generated + public List getExpectedSentimentSpans() { + return this.expectedSentimentSpans; + } + + /** + * Get the predictedSentimentSpans property: Represents the document's predicted sentiment labels. + * + * @return the predictedSentimentSpans value. + */ + @Generated + public List getPredictedSentimentSpans() { + return this.predictedSentimentSpans; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("expectedSentimentSpans", this.expectedSentimentSpans, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("predictedSentimentSpans", this.predictedSentimentSpans, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringDocumentTextSentimentEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringDocumentTextSentimentEvaluationResult if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringDocumentTextSentimentEvaluationResult. + */ + @Generated + public static TextAnalysisAuthoringDocumentTextSentimentEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List expectedSentimentSpans = null; + List predictedSentimentSpans = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedSentimentSpans".equals(fieldName)) { + expectedSentimentSpans = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult.fromJson(reader1)); + } else if ("predictedSentimentSpans".equals(fieldName)) { + predictedSentimentSpans = reader.readArray( + reader1 -> TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringDocumentTextSentimentEvaluationResult(expectedSentimentSpans, + predictedSentimentSpans); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityEvaluationSummary.java new file mode 100644 index 000000000000..dbc48018b617 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityEvaluationSummary.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for an entity. + */ +@Immutable +public final class TextAnalysisAuthoringEntityEvaluationSummary + implements JsonSerializable { + /* + * Represents the model precision + */ + @Generated + private final double f1; + + /* + * Represents the model recall + */ + @Generated + private final double precision; + + /* + * Represents the model F1 score + */ + @Generated + private final double recall; + + /* + * Represents the count of true positive + */ + @Generated + private final int truePositiveCount; + + /* + * Represents the count of true negative + */ + @Generated + private final int trueNegativeCount; + + /* + * Represents the count of false positive + */ + @Generated + private final int falsePositiveCount; + + /* + * Represents the count of false negative + */ + @Generated + private final int falseNegativeCount; + + /** + * Creates an instance of TextAnalysisAuthoringEntityEvaluationSummary class. + * + * @param f1 the f1 value to set. + * @param precision the precision value to set. + * @param recall the recall value to set. + * @param truePositiveCount the truePositiveCount value to set. + * @param trueNegativeCount the trueNegativeCount value to set. + * @param falsePositiveCount the falsePositiveCount value to set. + * @param falseNegativeCount the falseNegativeCount value to set. + */ + @Generated + private TextAnalysisAuthoringEntityEvaluationSummary(double f1, double precision, double recall, + int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) { + this.f1 = f1; + this.precision = precision; + this.recall = recall; + this.truePositiveCount = truePositiveCount; + this.trueNegativeCount = trueNegativeCount; + this.falsePositiveCount = falsePositiveCount; + this.falseNegativeCount = falseNegativeCount; + } + + /** + * Get the f1 property: Represents the model precision. + * + * @return the f1 value. + */ + @Generated + public double getF1() { + return this.f1; + } + + /** + * Get the precision property: Represents the model recall. + * + * @return the precision value. + */ + @Generated + public double getPrecision() { + return this.precision; + } + + /** + * Get the recall property: Represents the model F1 score. + * + * @return the recall value. + */ + @Generated + public double getRecall() { + return this.recall; + } + + /** + * Get the truePositiveCount property: Represents the count of true positive. + * + * @return the truePositiveCount value. + */ + @Generated + public int getTruePositiveCount() { + return this.truePositiveCount; + } + + /** + * Get the trueNegativeCount property: Represents the count of true negative. + * + * @return the trueNegativeCount value. + */ + @Generated + public int getTrueNegativeCount() { + return this.trueNegativeCount; + } + + /** + * Get the falsePositiveCount property: Represents the count of false positive. + * + * @return the falsePositiveCount value. + */ + @Generated + public int getFalsePositiveCount() { + return this.falsePositiveCount; + } + + /** + * Get the falseNegativeCount property: Represents the count of false negative. + * + * @return the falseNegativeCount value. + */ + @Generated + public int getFalseNegativeCount() { + return this.falseNegativeCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("f1", this.f1); + jsonWriter.writeDoubleField("precision", this.precision); + jsonWriter.writeDoubleField("recall", this.recall); + jsonWriter.writeIntField("truePositiveCount", this.truePositiveCount); + jsonWriter.writeIntField("trueNegativeCount", this.trueNegativeCount); + jsonWriter.writeIntField("falsePositiveCount", this.falsePositiveCount); + jsonWriter.writeIntField("falseNegativeCount", this.falseNegativeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEntityEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEntityEvaluationSummary if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEntityEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringEntityEvaluationSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double f1 = 0.0; + double precision = 0.0; + double recall = 0.0; + int truePositiveCount = 0; + int trueNegativeCount = 0; + int falsePositiveCount = 0; + int falseNegativeCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("f1".equals(fieldName)) { + f1 = reader.getDouble(); + } else if ("precision".equals(fieldName)) { + precision = reader.getDouble(); + } else if ("recall".equals(fieldName)) { + recall = reader.getDouble(); + } else if ("truePositiveCount".equals(fieldName)) { + truePositiveCount = reader.getInt(); + } else if ("trueNegativeCount".equals(fieldName)) { + trueNegativeCount = reader.getInt(); + } else if ("falsePositiveCount".equals(fieldName)) { + falsePositiveCount = reader.getInt(); + } else if ("falseNegativeCount".equals(fieldName)) { + falseNegativeCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringEntityEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityRecognitionEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityRecognitionEvaluationSummary.java new file mode 100644 index 000000000000..4ce239858395 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEntityRecognitionEvaluationSummary.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the evaluation summary for a custom entity recognition project. + */ +@Immutable +public final class TextAnalysisAuthoringEntityRecognitionEvaluationSummary + implements JsonSerializable { + /* + * 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. + */ + @Generated + private final TextAnalysisAuthoringConfusionMatrix confusionMatrix; + + /* + * Represents the entities evaluation + */ + @Generated + private final Map entities; + + /* + * Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microF1; + + /* + * Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microPrecision; + + /* + * Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microRecall; + + /* + * Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroF1; + + /* + * Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroPrecision; + + /* + * Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroRecall; + + /** + * Creates an instance of TextAnalysisAuthoringEntityRecognitionEvaluationSummary class. + * + * @param confusionMatrix the confusionMatrix value to set. + * @param entities the entities value to set. + * @param microF1 the microF1 value to set. + * @param microPrecision the microPrecision value to set. + * @param microRecall the microRecall value to set. + * @param macroF1 the macroF1 value to set. + * @param macroPrecision the macroPrecision value to set. + * @param macroRecall the macroRecall value to set. + */ + @Generated + private TextAnalysisAuthoringEntityRecognitionEvaluationSummary( + TextAnalysisAuthoringConfusionMatrix confusionMatrix, + Map entities, double microF1, double microPrecision, + double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.confusionMatrix = confusionMatrix; + this.entities = entities; + this.microF1 = microF1; + this.microPrecision = microPrecision; + this.microRecall = microRecall; + this.macroF1 = macroF1; + this.macroPrecision = macroPrecision; + this.macroRecall = macroRecall; + } + + /** + * Get the confusionMatrix property: 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. + * + * @return the confusionMatrix value. + */ + @Generated + public TextAnalysisAuthoringConfusionMatrix getConfusionMatrix() { + return this.confusionMatrix; + } + + /** + * Get the entities property: Represents the entities evaluation. + * + * @return the entities value. + */ + @Generated + public Map getEntities() { + return this.entities; + } + + /** + * Get the microF1 property: Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the microF1 value. + */ + @Generated + public double getMicroF1() { + return this.microF1; + } + + /** + * Get the microPrecision property: Represents the micro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the microPrecision value. + */ + @Generated + public double getMicroPrecision() { + return this.microPrecision; + } + + /** + * Get the microRecall property: Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the microRecall value. + */ + @Generated + public double getMicroRecall() { + return this.microRecall; + } + + /** + * Get the macroF1 property: Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroF1 value. + */ + @Generated + public double getMacroF1() { + return this.macroF1; + } + + /** + * Get the macroPrecision property: Represents the macro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the macroPrecision value. + */ + @Generated + public double getMacroPrecision() { + return this.macroPrecision; + } + + /** + * Get the macroRecall property: Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroRecall value. + */ + @Generated + public double getMacroRecall() { + return this.macroRecall; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("confusionMatrix", this.confusionMatrix); + jsonWriter.writeMapField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeDoubleField("microF1", this.microF1); + jsonWriter.writeDoubleField("microPrecision", this.microPrecision); + jsonWriter.writeDoubleField("microRecall", this.microRecall); + jsonWriter.writeDoubleField("macroF1", this.macroF1); + jsonWriter.writeDoubleField("macroPrecision", this.macroPrecision); + jsonWriter.writeDoubleField("macroRecall", this.macroRecall); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEntityRecognitionEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEntityRecognitionEvaluationSummary if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEntityRecognitionEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringEntityRecognitionEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringConfusionMatrix confusionMatrix = null; + Map entities = null; + double microF1 = 0.0; + double microPrecision = 0.0; + double microRecall = 0.0; + double macroF1 = 0.0; + double macroPrecision = 0.0; + double macroRecall = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confusionMatrix".equals(fieldName)) { + confusionMatrix = TextAnalysisAuthoringConfusionMatrix.fromJson(reader); + } else if ("entities".equals(fieldName)) { + entities + = reader.readMap(reader1 -> TextAnalysisAuthoringEntityEvaluationSummary.fromJson(reader1)); + } else if ("microF1".equals(fieldName)) { + microF1 = reader.getDouble(); + } else if ("microPrecision".equals(fieldName)) { + microPrecision = reader.getDouble(); + } else if ("microRecall".equals(fieldName)) { + microRecall = reader.getDouble(); + } else if ("macroF1".equals(fieldName)) { + macroF1 = reader.getDouble(); + } else if ("macroPrecision".equals(fieldName)) { + macroPrecision = reader.getDouble(); + } else if ("macroRecall".equals(fieldName)) { + macroRecall = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringEntityRecognitionEvaluationSummary(confusionMatrix, entities, microF1, + microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobResult.java new file mode 100644 index 000000000000..3eb96438e42d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobResult.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The TextAnalysisAuthoringEvaluationJobResult model. + */ +@Immutable +public final class TextAnalysisAuthoringEvaluationJobResult + implements JsonSerializable { + /* + * Represents the options used running the evaluation. + */ + @Generated + private final TextAnalysisAuthoringEvaluationOptions evaluationOptions; + + /* + * Represents trained model label. + */ + @Generated + private final String modelLabel; + + /* + * Represents training config version. + */ + @Generated + private final String trainingConfigVersion; + + /* + * Represents progress percentage. + */ + @Generated + private final int percentComplete; + + /** + * Creates an instance of TextAnalysisAuthoringEvaluationJobResult class. + * + * @param evaluationOptions the evaluationOptions value to set. + * @param modelLabel the modelLabel value to set. + * @param trainingConfigVersion the trainingConfigVersion value to set. + * @param percentComplete the percentComplete value to set. + */ + @Generated + private TextAnalysisAuthoringEvaluationJobResult(TextAnalysisAuthoringEvaluationOptions evaluationOptions, + String modelLabel, String trainingConfigVersion, int percentComplete) { + this.evaluationOptions = evaluationOptions; + this.modelLabel = modelLabel; + this.trainingConfigVersion = trainingConfigVersion; + this.percentComplete = percentComplete; + } + + /** + * Get the evaluationOptions property: Represents the options used running the evaluation. + * + * @return the evaluationOptions value. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions getEvaluationOptions() { + return this.evaluationOptions; + } + + /** + * Get the modelLabel property: Represents trained model label. + * + * @return the modelLabel value. + */ + @Generated + public String getModelLabel() { + return this.modelLabel; + } + + /** + * Get the trainingConfigVersion property: Represents training config version. + * + * @return the trainingConfigVersion value. + */ + @Generated + public String getTrainingConfigVersion() { + return this.trainingConfigVersion; + } + + /** + * Get the percentComplete property: Represents progress percentage. + * + * @return the percentComplete value. + */ + @Generated + public int getPercentComplete() { + return this.percentComplete; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", this.evaluationOptions); + jsonWriter.writeStringField("modelLabel", this.modelLabel); + jsonWriter.writeStringField("trainingConfigVersion", this.trainingConfigVersion); + jsonWriter.writeIntField("percentComplete", this.percentComplete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEvaluationJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEvaluationJobResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEvaluationJobResult. + */ + @Generated + public static TextAnalysisAuthoringEvaluationJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + String modelLabel = null; + String trainingConfigVersion = null; + int percentComplete = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("modelLabel".equals(fieldName)) { + modelLabel = reader.getString(); + } else if ("trainingConfigVersion".equals(fieldName)) { + trainingConfigVersion = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + percentComplete = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringEvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, + percentComplete); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobState.java new file mode 100644 index 000000000000..44de744440cd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationJobState.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a evaluation job. + */ +@Immutable +public final class TextAnalysisAuthoringEvaluationJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /* + * Represents evaluation task detailed result. + */ + @Generated + private final TextAnalysisAuthoringEvaluationJobResult result; + + /** + * Creates an instance of TextAnalysisAuthoringEvaluationJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + * @param result the result value to set. + */ + @Generated + private TextAnalysisAuthoringEvaluationJobState(OffsetDateTime createdDateTime, OffsetDateTime lastUpdatedDateTime, + JobStatus status, TextAnalysisAuthoringEvaluationJobResult result) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + this.result = result; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * Get the result property: Represents evaluation task detailed result. + * + * @return the result value. + */ + @Generated + public TextAnalysisAuthoringEvaluationJobResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEvaluationJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEvaluationJobState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEvaluationJobState. + */ + @Generated + public static TextAnalysisAuthoringEvaluationJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + TextAnalysisAuthoringEvaluationJobResult result = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("result".equals(fieldName)) { + result = TextAnalysisAuthoringEvaluationJobResult.fromJson(reader); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringEvaluationJobState deserializedTextAnalysisAuthoringEvaluationJobState + = new TextAnalysisAuthoringEvaluationJobState(createdDateTime, lastUpdatedDateTime, status, result); + deserializedTextAnalysisAuthoringEvaluationJobState.jobId = jobId; + deserializedTextAnalysisAuthoringEvaluationJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringEvaluationJobState.warnings = warnings; + deserializedTextAnalysisAuthoringEvaluationJobState.errors = errors; + + return deserializedTextAnalysisAuthoringEvaluationJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationOptions.java new file mode 100644 index 000000000000..f34ff4464b12 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationOptions.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the options used running the evaluation. + */ +@Fluent +public final class TextAnalysisAuthoringEvaluationOptions + implements JsonSerializable { + /* + * Represents the evaluation kind. By default, the evaluation kind is set to percentage. + */ + @Generated + private EvaluationKind kind; + + /* + * Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. + */ + @Generated + private Integer trainingSplitPercentage; + + /* + * Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. + */ + @Generated + private Integer testingSplitPercentage; + + /** + * Creates an instance of TextAnalysisAuthoringEvaluationOptions class. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions() { + } + + /** + * Get the kind property: Represents the evaluation kind. By default, the evaluation kind is set to percentage. + * + * @return the kind value. + */ + @Generated + public EvaluationKind getKind() { + return this.kind; + } + + /** + * Set the kind property: Represents the evaluation kind. By default, the evaluation kind is set to percentage. + * + * @param kind the kind value to set. + * @return the TextAnalysisAuthoringEvaluationOptions object itself. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions setKind(EvaluationKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the trainingSplitPercentage property: Represents the training dataset split percentage. Only needed in case + * the evaluation kind is percentage. + * + * @return the trainingSplitPercentage value. + */ + @Generated + public Integer getTrainingSplitPercentage() { + return this.trainingSplitPercentage; + } + + /** + * Set the trainingSplitPercentage property: Represents the training dataset split percentage. Only needed in case + * the evaluation kind is percentage. + * + * @param trainingSplitPercentage the trainingSplitPercentage value to set. + * @return the TextAnalysisAuthoringEvaluationOptions object itself. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions setTrainingSplitPercentage(Integer trainingSplitPercentage) { + this.trainingSplitPercentage = trainingSplitPercentage; + return this; + } + + /** + * Get the testingSplitPercentage property: Represents the testing dataset split percentage. Only needed in case the + * evaluation kind is percentage. + * + * @return the testingSplitPercentage value. + */ + @Generated + public Integer getTestingSplitPercentage() { + return this.testingSplitPercentage; + } + + /** + * Set the testingSplitPercentage property: Represents the testing dataset split percentage. Only needed in case the + * evaluation kind is percentage. + * + * @param testingSplitPercentage the testingSplitPercentage value to set. + * @return the TextAnalysisAuthoringEvaluationOptions object itself. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions setTestingSplitPercentage(Integer testingSplitPercentage) { + this.testingSplitPercentage = testingSplitPercentage; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("trainingSplitPercentage", this.trainingSplitPercentage); + jsonWriter.writeNumberField("testingSplitPercentage", this.testingSplitPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEvaluationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEvaluationOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEvaluationOptions. + */ + @Generated + public static TextAnalysisAuthoringEvaluationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions deserializedTextAnalysisAuthoringEvaluationOptions + = new TextAnalysisAuthoringEvaluationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTextAnalysisAuthoringEvaluationOptions.kind + = EvaluationKind.fromString(reader.getString()); + } else if ("trainingSplitPercentage".equals(fieldName)) { + deserializedTextAnalysisAuthoringEvaluationOptions.trainingSplitPercentage + = reader.getNullable(JsonReader::getInt); + } else if ("testingSplitPercentage".equals(fieldName)) { + deserializedTextAnalysisAuthoringEvaluationOptions.testingSplitPercentage + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringEvaluationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationSummary.java new file mode 100644 index 000000000000..48acc3a7bfc0 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringEvaluationSummary.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the summary for an evaluation operation. + */ +@Immutable +public class TextAnalysisAuthoringEvaluationSummary + implements JsonSerializable { + /* + * Represents the project type that the evaluation ran on. + */ + @Generated + private ProjectKind projectKind = ProjectKind.fromString("TextAnalysisAuthoringEvaluationSummary"); + + /* + * Represents the options used running the evaluation. + */ + @Generated + private final TextAnalysisAuthoringEvaluationOptions evaluationOptions; + + /** + * Creates an instance of TextAnalysisAuthoringEvaluationSummary class. + * + * @param evaluationOptions the evaluationOptions value to set. + */ + @Generated + protected TextAnalysisAuthoringEvaluationSummary(TextAnalysisAuthoringEvaluationOptions evaluationOptions) { + this.evaluationOptions = evaluationOptions; + } + + /** + * Get the projectKind property: Represents the project type that the evaluation ran on. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the evaluationOptions property: Represents the options used running the evaluation. + * + * @return the evaluationOptions value. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions getEvaluationOptions() { + return this.evaluationOptions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("evaluationOptions", this.evaluationOptions); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringEvaluationSummary if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringEvaluationSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("projectKind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CustomEntityRecognition".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary.fromJson(readerToUse.reset()); + } else if ("CustomHealthcare".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomHealthcareEvaluationSummary.fromJson(readerToUse.reset()); + } else if ("CustomMultiLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary + .fromJson(readerToUse.reset()); + } else if ("CustomSingleLabelClassification".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary + .fromJson(readerToUse.reset()); + } else if ("CustomTextSentiment".equals(discriminatorValue)) { + return TextAnalysisAuthoringCustomTextSentimentEvaluationSummary.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static TextAnalysisAuthoringEvaluationSummary fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + ProjectKind projectKind = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringEvaluationSummary deserializedTextAnalysisAuthoringEvaluationSummary + = new TextAnalysisAuthoringEvaluationSummary(evaluationOptions); + deserializedTextAnalysisAuthoringEvaluationSummary.projectKind = projectKind; + + return deserializedTextAnalysisAuthoringEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportProjectJobState.java new file mode 100644 index 000000000000..1b33b377a515 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportProjectJobState.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of an export job. + */ +@Immutable +public final class TextAnalysisAuthoringExportProjectJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /* + * The URL to use in order to download the exported project. + */ + @Generated + private String resultUrl; + + /** + * Creates an instance of TextAnalysisAuthoringExportProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringExportProjectJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * Get the resultUrl property: The URL to use in order to download the exported project. + * + * @return the resultUrl value. + */ + @Generated + public String getResultUrl() { + return this.resultUrl; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resultUrl", this.resultUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportProjectJobState if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportProjectJobState. + */ + @Generated + public static TextAnalysisAuthoringExportProjectJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + String resultUrl = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else if ("resultUrl".equals(fieldName)) { + resultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringExportProjectJobState deserializedTextAnalysisAuthoringExportProjectJobState + = new TextAnalysisAuthoringExportProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringExportProjectJobState.jobId = jobId; + deserializedTextAnalysisAuthoringExportProjectJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringExportProjectJobState.warnings = warnings; + deserializedTextAnalysisAuthoringExportProjectJobState.errors = errors; + deserializedTextAnalysisAuthoringExportProjectJobState.resultUrl = resultUrl; + + return deserializedTextAnalysisAuthoringExportProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedClass.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedClass.java new file mode 100644 index 000000000000..60be3761f875 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedClass.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a class of an exported project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedClass implements JsonSerializable { + /* + * The class category. + */ + @Generated + private String category; + + /** + * Creates an instance of TextAnalysisAuthoringExportedClass class. + */ + @Generated + public TextAnalysisAuthoringExportedClass() { + } + + /** + * Get the category property: The class category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Set the category property: The class category. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedClass object itself. + */ + @Generated + public TextAnalysisAuthoringExportedClass setCategory(String category) { + this.category = category; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedClass from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedClass if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedClass. + */ + @Generated + public static TextAnalysisAuthoringExportedClass fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedClass deserializedTextAnalysisAuthoringExportedClass + = new TextAnalysisAuthoringExportedClass(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedClass.category = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedClass; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCompositeEntity.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCompositeEntity.java new file mode 100644 index 000000000000..064ca254934e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCompositeEntity.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an entity in an exported project with composite entities enabled. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCompositeEntity + implements JsonSerializable { + /* + * The behavior to follow when the entity's components overlap with each other. + */ + @Generated + private CompositionSetting compositionSetting; + + /* + * The list component of the entity. + */ + @Generated + private TextAnalysisAuthoringExportedEntityList list; + + /* + * The prebuilt entities components. + */ + @Generated + private List prebuilts; + + /* + * The entity category. + */ + @Generated + private String category; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCompositeEntity class. + */ + @Generated + public TextAnalysisAuthoringExportedCompositeEntity() { + } + + /** + * Get the compositionSetting property: The behavior to follow when the entity's components overlap with each other. + * + * @return the compositionSetting value. + */ + @Generated + public CompositionSetting getCompositionSetting() { + return this.compositionSetting; + } + + /** + * Set the compositionSetting property: The behavior to follow when the entity's components overlap with each other. + * + * @param compositionSetting the compositionSetting value to set. + * @return the TextAnalysisAuthoringExportedCompositeEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCompositeEntity setCompositionSetting(CompositionSetting compositionSetting) { + this.compositionSetting = compositionSetting; + return this; + } + + /** + * Get the list property: The list component of the entity. + * + * @return the list value. + */ + @Generated + public TextAnalysisAuthoringExportedEntityList getList() { + return this.list; + } + + /** + * Set the list property: The list component of the entity. + * + * @param list the list value to set. + * @return the TextAnalysisAuthoringExportedCompositeEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCompositeEntity setList(TextAnalysisAuthoringExportedEntityList list) { + this.list = list; + return this; + } + + /** + * Get the prebuilts property: The prebuilt entities components. + * + * @return the prebuilts value. + */ + @Generated + public List getPrebuilts() { + return this.prebuilts; + } + + /** + * Set the prebuilts property: The prebuilt entities components. + * + * @param prebuilts the prebuilts value to set. + * @return the TextAnalysisAuthoringExportedCompositeEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCompositeEntity + setPrebuilts(List prebuilts) { + this.prebuilts = prebuilts; + return this; + } + + /** + * Get the category property: The entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Set the category property: The entity category. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedCompositeEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCompositeEntity setCategory(String category) { + this.category = category; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("compositionSetting", + this.compositionSetting == null ? null : this.compositionSetting.toString()); + jsonWriter.writeJsonField("list", this.list); + jsonWriter.writeArrayField("prebuilts", this.prebuilts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("category", this.category); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCompositeEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCompositeEntity if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedCompositeEntity. + */ + @Generated + public static TextAnalysisAuthoringExportedCompositeEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCompositeEntity deserializedTextAnalysisAuthoringExportedCompositeEntity + = new TextAnalysisAuthoringExportedCompositeEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("compositionSetting".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCompositeEntity.compositionSetting + = CompositionSetting.fromString(reader.getString()); + } else if ("list".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCompositeEntity.list + = TextAnalysisAuthoringExportedEntityList.fromJson(reader); + } else if ("prebuilts".equals(fieldName)) { + List prebuilts + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedPrebuiltEntity.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCompositeEntity.prebuilts = prebuilts; + } else if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCompositeEntity.category = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCompositeEntity; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.java new file mode 100644 index 000000000000..e298fb62381e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an exported document for a custom abstractive summarization project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument + implements JsonSerializable { + /* + * Represents the summary file location in the blob store container associated with the project. + */ + @Generated + private final String summaryLocation; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument class. + * + * @param summaryLocation the summaryLocation value to set. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument(String summaryLocation) { + this.summaryLocation = summaryLocation; + } + + /** + * Get the summaryLocation property: Represents the summary file location in the blob store container associated + * with the project. + * + * @return the summaryLocation value. + */ + @Generated + public String getSummaryLocation() { + return this.summaryLocation; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("summaryLocation", this.summaryLocation); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String summaryLocation = null; + String location = null; + String language = null; + String dataset = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summaryLocation".equals(fieldName)) { + summaryLocation = reader.getString(); + } else if ("location".equals(fieldName)) { + location = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("dataset".equals(fieldName)) { + dataset = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument + = new TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument(summaryLocation); + deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.location = location; + deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.language = language; + deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument.dataset = dataset; + + return deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets.java new file mode 100644 index 000000000000..1c3b8da4b895 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for an abstractive summarization project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets + extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_ABSTRACTIVE_SUMMARIZATION; + + /* + * The list of documents belonging to this project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the documents property: The list of documents belonging to this project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents belonging to this project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets if the JsonReader + * was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets + = new TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("documents".equals(fieldName)) { + List documents = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument + .fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets.documents + = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionDocument.java new file mode 100644 index 000000000000..fd4773121aad --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionDocument.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an exported document for a custom entity recognition project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomEntityRecognitionDocument + implements JsonSerializable { + /* + * The list of entity labels belonging to the document. + */ + @Generated + private List entities; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomEntityRecognitionDocument class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionDocument() { + } + + /** + * Get the entities property: The list of entity labels belonging to the document. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: The list of entity labels belonging to the document. + * + * @param entities the entities value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionDocument + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomEntityRecognitionDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomEntityRecognitionDocument if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomEntityRecognitionDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomEntityRecognitionDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomEntityRecognitionDocument deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument + = new TextAnalysisAuthoringExportedCustomEntityRecognitionDocument(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + List entities = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedDocumentEntityRegion.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument.entities = entities; + } else if ("location".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument.location + = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument.language + = reader.getString(); + } else if ("dataset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument.dataset + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.java new file mode 100644 index 000000000000..42c4a9c7d761 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for a entity recognition project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_ENTITY_RECOGNITION; + + /* + * The list of entities belonging to the project. + */ + @Generated + private List entities; + + /* + * The list of documents belonging to the project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the entities property: The list of entities belonging to the project. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: The list of entities belonging to the project. + * + * @param entities the entities value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the documents property: The list of documents belonging to the project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents belonging to the project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets + = new TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("entities".equals(fieldName)) { + List entities + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedEntity.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.entities = entities; + } else if ("documents".equals(fieldName)) { + List documents = reader.readArray( + reader1 -> TextAnalysisAuthoringExportedCustomEntityRecognitionDocument.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets.documents = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareDocument.java new file mode 100644 index 000000000000..3dbc064df519 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareDocument.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an exported document for a CustomHealthcare project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomHealthcareDocument + implements JsonSerializable { + /* + * The list of entity labels belonging to the document. + */ + @Generated + private List entities; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomHealthcareDocument class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareDocument() { + } + + /** + * Get the entities property: The list of entity labels belonging to the document. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: The list of entity labels belonging to the document. + * + * @param entities the entities value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareDocument + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomHealthcareDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomHealthcareDocument if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedCustomHealthcareDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomHealthcareDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomHealthcareDocument deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument + = new TextAnalysisAuthoringExportedCustomHealthcareDocument(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + List entities = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedDocumentEntityRegion.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument.entities = entities; + } else if ("location".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument.location = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument.language = reader.getString(); + } else if ("dataset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument.dataset = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomHealthcareDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareProjectAssets.java new file mode 100644 index 000000000000..0b560e258599 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomHealthcareProjectAssets.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for a CustomHealthcare project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomHealthcareProjectAssets extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_HEALTHCARE; + + /* + * The list of entities belonging to the project. + */ + @Generated + private List entities; + + /* + * The list of documents belonging to the project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomHealthcareProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the entities property: The list of entities belonging to the project. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: The list of entities belonging to the project. + * + * @param entities the entities value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareProjectAssets + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the documents property: The list of documents belonging to the project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents belonging to the project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomHealthcareProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomHealthcareProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomHealthcareProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomHealthcareProjectAssets if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomHealthcareProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomHealthcareProjectAssets fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomHealthcareProjectAssets deserializedTextAnalysisAuthoringExportedCustomHealthcareProjectAssets + = new TextAnalysisAuthoringExportedCustomHealthcareProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomHealthcareProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("entities".equals(fieldName)) { + List entities + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedCompositeEntity.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomHealthcareProjectAssets.entities = entities; + } else if ("documents".equals(fieldName)) { + List documents = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedCustomHealthcareDocument.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomHealthcareProjectAssets.documents = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomHealthcareProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.java new file mode 100644 index 000000000000..5e0b43883da7 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an exported document of a custom multi-label classification project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument + implements JsonSerializable { + /* + * The document classes. + */ + @Generated + private List classes; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument() { + } + + /** + * Get the classes property: The document classes. + * + * @return the classes value. + */ + @Generated + public List getClasses() { + return this.classes; + } + + /** + * Set the classes property: The document classes. + * + * @param classes the classes value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument + setClasses(List classes) { + this.classes = classes; + return this; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("classes", this.classes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument + = new TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("classes".equals(fieldName)) { + List classes + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedDocumentClass.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.classes = classes; + } else if ("location".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.location + = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.language + = reader.getString(); + } else if ("dataset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument.dataset + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.java new file mode 100644 index 000000000000..ab8620214a2d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for a custom multi-label classification project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_MULTI_LABEL_CLASSIFICATION; + + /* + * The list of classes in the project. + */ + @Generated + private List classes; + + /* + * The list of documents in the project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the classes property: The list of classes in the project. + * + * @return the classes value. + */ + @Generated + public List getClasses() { + return this.classes; + } + + /** + * Set the classes property: The list of classes in the project. + * + * @param classes the classes value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + setClasses(List classes) { + this.classes = classes; + return this; + } + + /** + * Get the documents property: The list of documents in the project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents in the project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("classes", this.classes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets if the JsonReader + * was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets + = new TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("classes".equals(fieldName)) { + List classes + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedClass.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.classes + = classes; + } else if ("documents".equals(fieldName)) { + List documents = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument + .fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets.documents + = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.java new file mode 100644 index 000000000000..6fb81e825aa7 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an exported document for a custom single-label classification project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument + implements JsonSerializable { + /* + * The class of the documents. + */ + @Generated + private TextAnalysisAuthoringExportedDocumentClass classProperty; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument() { + } + + /** + * Get the classProperty property: The class of the documents. + * + * @return the classProperty value. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentClass getClassProperty() { + return this.classProperty; + } + + /** + * Set the classProperty property: The class of the documents. + * + * @param classProperty the classProperty value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument + setClassProperty(TextAnalysisAuthoringExportedDocumentClass classProperty) { + this.classProperty = classProperty; + return this; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("class", this.classProperty); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument + = new TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("class".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.classProperty + = TextAnalysisAuthoringExportedDocumentClass.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.location + = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.language + = reader.getString(); + } else if ("dataset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument.dataset + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.java new file mode 100644 index 000000000000..3476c93148be --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for a single-label classification project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_SINGLE_LABEL_CLASSIFICATION; + + /* + * The list of classes belonging to this project. + */ + @Generated + private List classes; + + /* + * The list of documents belonging to this project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the classes property: The list of classes belonging to this project. + * + * @return the classes value. + */ + @Generated + public List getClasses() { + return this.classes; + } + + /** + * Set the classes property: The list of classes belonging to this project. + * + * @param classes the classes value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + setClasses(List classes) { + this.classes = classes; + return this; + } + + /** + * Get the documents property: The list of documents belonging to this project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents belonging to this project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("classes", this.classes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets + = new TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("classes".equals(fieldName)) { + List classes + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedClass.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.classes + = classes; + } else if ("documents".equals(fieldName)) { + List documents = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument + .fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets.documents + = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentDocument.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentDocument.java new file mode 100644 index 000000000000..f89541315fbb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentDocument.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an exported document for a custom text sentiment project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomTextSentimentDocument + implements JsonSerializable { + /* + * The sentimentSpans property. + */ + @Generated + private List sentimentSpans; + + /* + * The location of the document in the storage. + */ + @Generated + private 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. + */ + @Generated + private String language; + + /* + * The dataset for this document. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomTextSentimentDocument class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentDocument() { + } + + /** + * Get the sentimentSpans property: The sentimentSpans property. + * + * @return the sentimentSpans value. + */ + @Generated + public List getSentimentSpans() { + return this.sentimentSpans; + } + + /** + * Set the sentimentSpans property: The sentimentSpans property. + * + * @param sentimentSpans the sentimentSpans value to set. + * @return the TextAnalysisAuthoringExportedCustomTextSentimentDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentDocument + setSentimentSpans(List sentimentSpans) { + this.sentimentSpans = sentimentSpans; + return this; + } + + /** + * Get the location property: The location of the document in the storage. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Set the location property: The location of the document in the storage. + * + * @param location the location value to set. + * @return the TextAnalysisAuthoringExportedCustomTextSentimentDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentDocument setLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedCustomTextSentimentDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentDocument setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @return the dataset value. + */ + @Generated + public String getDataset() { + return this.dataset; + } + + /** + * Set the dataset property: The dataset for this document. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the TextAnalysisAuthoringExportedCustomTextSentimentDocument object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentDocument setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sentimentSpans", this.sentimentSpans, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomTextSentimentDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomTextSentimentDocument if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomTextSentimentDocument. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomTextSentimentDocument fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomTextSentimentDocument deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument + = new TextAnalysisAuthoringExportedCustomTextSentimentDocument(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sentimentSpans".equals(fieldName)) { + List sentimentSpans = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedDocumentSentimentLabel.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument.sentimentSpans + = sentimentSpans; + } else if ("location".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument.location = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument.language = reader.getString(); + } else if ("dataset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument.dataset = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomTextSentimentDocument; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.java new file mode 100644 index 000000000000..ce0c1f166f2a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the exported assets for a custom text sentiment project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets extends ExportedProjectAssets { + /* + * The projectKind property. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CUSTOM_TEXT_SENTIMENT; + + /* + * The list of documents belonging to the project. + */ + @Generated + private List documents; + + /** + * Creates an instance of TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets class. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets() { + } + + /** + * Get the projectKind property: The projectKind property. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the documents property: The list of documents belonging to the project. + * + * @return the documents value. + */ + @Generated + public List getDocuments() { + return this.documents; + } + + /** + * Set the documents property: The list of documents belonging to the project. + * + * @param documents the documents value to set. + * @return the TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets object itself. + */ + @Generated + public TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets + setDocuments(List documents) { + this.documents = documents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeArrayField("documents", this.documents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets. + */ + @Generated + public static TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets deserializedTextAnalysisAuthoringExportedCustomTextSentimentProjectAssets + = new TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("documents".equals(fieldName)) { + List documents = reader.readArray( + reader1 -> TextAnalysisAuthoringExportedCustomTextSentimentDocument.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedCustomTextSentimentProjectAssets.documents = documents; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedCustomTextSentimentProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentClass.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentClass.java new file mode 100644 index 000000000000..3ff677f806c1 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentClass.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a classification label for a document. + */ +@Fluent +public final class TextAnalysisAuthoringExportedDocumentClass + implements JsonSerializable { + /* + * The category property. + */ + @Generated + private String category; + + /** + * Creates an instance of TextAnalysisAuthoringExportedDocumentClass class. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentClass() { + } + + /** + * Get the category property: The category property. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Set the category property: The category property. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedDocumentClass object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentClass setCategory(String category) { + this.category = category; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedDocumentClass from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedDocumentClass if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedDocumentClass. + */ + @Generated + public static TextAnalysisAuthoringExportedDocumentClass fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedDocumentClass deserializedTextAnalysisAuthoringExportedDocumentClass + = new TextAnalysisAuthoringExportedDocumentClass(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentClass.category = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedDocumentClass; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityLabel.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityLabel.java new file mode 100644 index 000000000000..de25b4193ec2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityLabel.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an entity label for a document. + */ +@Fluent +public final class TextAnalysisAuthoringExportedDocumentEntityLabel + implements JsonSerializable { + /* + * The entity category. + */ + @Generated + private String category; + + /* + * Start position for the entity text. + */ + @Generated + private Integer offset; + + /* + * Length for the entity text. + */ + @Generated + private Integer length; + + /** + * Creates an instance of TextAnalysisAuthoringExportedDocumentEntityLabel class. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityLabel() { + } + + /** + * Get the category property: The entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Set the category property: The entity category. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityLabel setCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the offset property: Start position for the entity text. + * + * @return the offset value. + */ + @Generated + public Integer getOffset() { + return this.offset; + } + + /** + * Set the offset property: Start position for the entity text. + * + * @param offset the offset value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityLabel setOffset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Get the length property: Length for the entity text. + * + * @return the length value. + */ + @Generated + public Integer getLength() { + return this.length; + } + + /** + * Set the length property: Length for the entity text. + * + * @param length the length value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityLabel setLength(Integer length) { + this.length = length; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeNumberField("offset", this.offset); + jsonWriter.writeNumberField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedDocumentEntityLabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedDocumentEntityLabel if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedDocumentEntityLabel. + */ + @Generated + public static TextAnalysisAuthoringExportedDocumentEntityLabel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedDocumentEntityLabel deserializedTextAnalysisAuthoringExportedDocumentEntityLabel + = new TextAnalysisAuthoringExportedDocumentEntityLabel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentEntityLabel.category = reader.getString(); + } else if ("offset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentEntityLabel.offset + = reader.getNullable(JsonReader::getInt); + } else if ("length".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentEntityLabel.length + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedDocumentEntityLabel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityRegion.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityRegion.java new file mode 100644 index 000000000000..e81b0135b6f1 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentEntityRegion.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a region in a document for entity labeling. + */ +@Fluent +public final class TextAnalysisAuthoringExportedDocumentEntityRegion + implements JsonSerializable { + /* + * Start position for the region. + */ + @Generated + private Integer regionOffset; + + /* + * Length for the region text. + */ + @Generated + private Integer regionLength; + + /* + * The list of entity labels belonging to this region. + */ + @Generated + private List labels; + + /** + * Creates an instance of TextAnalysisAuthoringExportedDocumentEntityRegion class. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityRegion() { + } + + /** + * Get the regionOffset property: Start position for the region. + * + * @return the regionOffset value. + */ + @Generated + public Integer getRegionOffset() { + return this.regionOffset; + } + + /** + * Set the regionOffset property: Start position for the region. + * + * @param regionOffset the regionOffset value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityRegion object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityRegion setRegionOffset(Integer regionOffset) { + this.regionOffset = regionOffset; + return this; + } + + /** + * Get the regionLength property: Length for the region text. + * + * @return the regionLength value. + */ + @Generated + public Integer getRegionLength() { + return this.regionLength; + } + + /** + * Set the regionLength property: Length for the region text. + * + * @param regionLength the regionLength value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityRegion object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityRegion setRegionLength(Integer regionLength) { + this.regionLength = regionLength; + return this; + } + + /** + * Get the labels property: The list of entity labels belonging to this region. + * + * @return the labels value. + */ + @Generated + public List getLabels() { + return this.labels; + } + + /** + * Set the labels property: The list of entity labels belonging to this region. + * + * @param labels the labels value to set. + * @return the TextAnalysisAuthoringExportedDocumentEntityRegion object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentEntityRegion + setLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("regionOffset", this.regionOffset); + jsonWriter.writeNumberField("regionLength", this.regionLength); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedDocumentEntityRegion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedDocumentEntityRegion if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedDocumentEntityRegion. + */ + @Generated + public static TextAnalysisAuthoringExportedDocumentEntityRegion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedDocumentEntityRegion deserializedTextAnalysisAuthoringExportedDocumentEntityRegion + = new TextAnalysisAuthoringExportedDocumentEntityRegion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regionOffset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentEntityRegion.regionOffset + = reader.getNullable(JsonReader::getInt); + } else if ("regionLength".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentEntityRegion.regionLength + = reader.getNullable(JsonReader::getInt); + } else if ("labels".equals(fieldName)) { + List labels = reader + .readArray(reader1 -> TextAnalysisAuthoringExportedDocumentEntityLabel.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedDocumentEntityRegion.labels = labels; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedDocumentEntityRegion; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentSentimentLabel.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentSentimentLabel.java new file mode 100644 index 000000000000..8c4f2002468b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedDocumentSentimentLabel.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an entity label for a document. + */ +@Fluent +public final class TextAnalysisAuthoringExportedDocumentSentimentLabel + implements JsonSerializable { + /* + * The sentiment category. + */ + @Generated + private Sentiment category; + + /* + * Start position for the sentiment text. + */ + @Generated + private Integer offset; + + /* + * Length for the sentiment text. + */ + @Generated + private Integer length; + + /** + * Creates an instance of TextAnalysisAuthoringExportedDocumentSentimentLabel class. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentSentimentLabel() { + } + + /** + * Get the category property: The sentiment category. + * + * @return the category value. + */ + @Generated + public Sentiment getCategory() { + return this.category; + } + + /** + * Set the category property: The sentiment category. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedDocumentSentimentLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentSentimentLabel setCategory(Sentiment category) { + this.category = category; + return this; + } + + /** + * Get the offset property: Start position for the sentiment text. + * + * @return the offset value. + */ + @Generated + public Integer getOffset() { + return this.offset; + } + + /** + * Set the offset property: Start position for the sentiment text. + * + * @param offset the offset value to set. + * @return the TextAnalysisAuthoringExportedDocumentSentimentLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentSentimentLabel setOffset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Get the length property: Length for the sentiment text. + * + * @return the length value. + */ + @Generated + public Integer getLength() { + return this.length; + } + + /** + * Set the length property: Length for the sentiment text. + * + * @param length the length value to set. + * @return the TextAnalysisAuthoringExportedDocumentSentimentLabel object itself. + */ + @Generated + public TextAnalysisAuthoringExportedDocumentSentimentLabel setLength(Integer length) { + this.length = length; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeNumberField("offset", this.offset); + jsonWriter.writeNumberField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedDocumentSentimentLabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedDocumentSentimentLabel if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedDocumentSentimentLabel. + */ + @Generated + public static TextAnalysisAuthoringExportedDocumentSentimentLabel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedDocumentSentimentLabel deserializedTextAnalysisAuthoringExportedDocumentSentimentLabel + = new TextAnalysisAuthoringExportedDocumentSentimentLabel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentSentimentLabel.category + = Sentiment.fromString(reader.getString()); + } else if ("offset".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentSentimentLabel.offset + = reader.getNullable(JsonReader::getInt); + } else if ("length".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedDocumentSentimentLabel.length + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedDocumentSentimentLabel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntity.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntity.java new file mode 100644 index 000000000000..51993bba43fa --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntity.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an entity in an exported project. + */ +@Fluent +public final class TextAnalysisAuthoringExportedEntity + implements JsonSerializable { + /* + * The entity category. + */ + @Generated + private String category; + + /* + * Short description for entity category. Required when enabling synthetic data generation. + */ + @Generated + private String description; + + /** + * Creates an instance of TextAnalysisAuthoringExportedEntity class. + */ + @Generated + public TextAnalysisAuthoringExportedEntity() { + } + + /** + * Get the category property: The entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Set the category property: The entity category. + * + * @param category the category value to set. + * @return the TextAnalysisAuthoringExportedEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntity setCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the description property: Short description for entity category. Required when enabling synthetic data + * generation. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Short description for entity category. Required when enabling synthetic data + * generation. + * + * @param description the description value to set. + * @return the TextAnalysisAuthoringExportedEntity object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntity setDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedEntity if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedEntity. + */ + @Generated + public static TextAnalysisAuthoringExportedEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedEntity deserializedTextAnalysisAuthoringExportedEntity + = new TextAnalysisAuthoringExportedEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedEntity.category = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedEntity.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedEntity; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityList.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityList.java new file mode 100644 index 000000000000..453172faa53d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityList.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a list component of an entity. + */ +@Fluent +public final class TextAnalysisAuthoringExportedEntityList + implements JsonSerializable { + /* + * The sub-lists of the list component. + */ + @Generated + private List sublists; + + /** + * Creates an instance of TextAnalysisAuthoringExportedEntityList class. + */ + @Generated + public TextAnalysisAuthoringExportedEntityList() { + } + + /** + * Get the sublists property: The sub-lists of the list component. + * + * @return the sublists value. + */ + @Generated + public List getSublists() { + return this.sublists; + } + + /** + * Set the sublists property: The sub-lists of the list component. + * + * @param sublists the sublists value to set. + * @return the TextAnalysisAuthoringExportedEntityList object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntityList + setSublists(List sublists) { + this.sublists = sublists; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sublists", this.sublists, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedEntityList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedEntityList if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedEntityList. + */ + @Generated + public static TextAnalysisAuthoringExportedEntityList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedEntityList deserializedTextAnalysisAuthoringExportedEntityList + = new TextAnalysisAuthoringExportedEntityList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sublists".equals(fieldName)) { + List sublists + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedEntitySublist.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedEntityList.sublists = sublists; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedEntityList; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityListSynonym.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityListSynonym.java new file mode 100644 index 000000000000..f208cfec8b6c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntityListSynonym.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a list of synonyms inside a list component. + */ +@Fluent +public final class TextAnalysisAuthoringExportedEntityListSynonym + implements JsonSerializable { + /* + * 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. + */ + @Generated + private String language; + + /* + * The list of synonyms. + */ + @Generated + private List values; + + /** + * Creates an instance of TextAnalysisAuthoringExportedEntityListSynonym class. + */ + @Generated + public TextAnalysisAuthoringExportedEntityListSynonym() { + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: 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. + * + * @param language the language value to set. + * @return the TextAnalysisAuthoringExportedEntityListSynonym object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntityListSynonym setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the values property: The list of synonyms. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } + + /** + * Set the values property: The list of synonyms. + * + * @param values the values value to set. + * @return the TextAnalysisAuthoringExportedEntityListSynonym object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntityListSynonym setValues(List values) { + this.values = values; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedEntityListSynonym from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedEntityListSynonym if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedEntityListSynonym. + */ + @Generated + public static TextAnalysisAuthoringExportedEntityListSynonym fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedEntityListSynonym deserializedTextAnalysisAuthoringExportedEntityListSynonym + = new TextAnalysisAuthoringExportedEntityListSynonym(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("language".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedEntityListSynonym.language = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedTextAnalysisAuthoringExportedEntityListSynonym.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedEntityListSynonym; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntitySublist.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntitySublist.java new file mode 100644 index 000000000000..f4bfce18e695 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedEntitySublist.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a sub-list inside a list component. + */ +@Fluent +public final class TextAnalysisAuthoringExportedEntitySublist + implements JsonSerializable { + /* + * The key of the sub-list. + */ + @Generated + private String listKey; + + /* + * The phrases of that correspond to the sub-list. + */ + @Generated + private List synonyms; + + /** + * Creates an instance of TextAnalysisAuthoringExportedEntitySublist class. + */ + @Generated + public TextAnalysisAuthoringExportedEntitySublist() { + } + + /** + * Get the listKey property: The key of the sub-list. + * + * @return the listKey value. + */ + @Generated + public String getListKey() { + return this.listKey; + } + + /** + * Set the listKey property: The key of the sub-list. + * + * @param listKey the listKey value to set. + * @return the TextAnalysisAuthoringExportedEntitySublist object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntitySublist setListKey(String listKey) { + this.listKey = listKey; + return this; + } + + /** + * Get the synonyms property: The phrases of that correspond to the sub-list. + * + * @return the synonyms value. + */ + @Generated + public List getSynonyms() { + return this.synonyms; + } + + /** + * Set the synonyms property: The phrases of that correspond to the sub-list. + * + * @param synonyms the synonyms value to set. + * @return the TextAnalysisAuthoringExportedEntitySublist object itself. + */ + @Generated + public TextAnalysisAuthoringExportedEntitySublist + setSynonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("listKey", this.listKey); + jsonWriter.writeArrayField("synonyms", this.synonyms, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedEntitySublist from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedEntitySublist if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedEntitySublist. + */ + @Generated + public static TextAnalysisAuthoringExportedEntitySublist fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringExportedEntitySublist deserializedTextAnalysisAuthoringExportedEntitySublist + = new TextAnalysisAuthoringExportedEntitySublist(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("listKey".equals(fieldName)) { + deserializedTextAnalysisAuthoringExportedEntitySublist.listKey = reader.getString(); + } else if ("synonyms".equals(fieldName)) { + List synonyms + = reader.readArray(reader1 -> TextAnalysisAuthoringExportedEntityListSynonym.fromJson(reader1)); + deserializedTextAnalysisAuthoringExportedEntitySublist.synonyms = synonyms; + } else { + reader.skipChildren(); + } + } + + return deserializedTextAnalysisAuthoringExportedEntitySublist; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelJobState.java new file mode 100644 index 000000000000..ed37f135744e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a job to create or updated an exported model. + */ +@Immutable +public final class TextAnalysisAuthoringExportedModelJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringExportedModelJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringExportedModelJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedModelJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedModelJobState if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedModelJobState. + */ + @Generated + public static TextAnalysisAuthoringExportedModelJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringExportedModelJobState deserializedTextAnalysisAuthoringExportedModelJobState + = new TextAnalysisAuthoringExportedModelJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringExportedModelJobState.jobId = jobId; + deserializedTextAnalysisAuthoringExportedModelJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringExportedModelJobState.warnings = warnings; + deserializedTextAnalysisAuthoringExportedModelJobState.errors = errors; + + return deserializedTextAnalysisAuthoringExportedModelJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelManifest.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelManifest.java new file mode 100644 index 000000000000..9446dbd0d720 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelManifest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the properties for the exported model manifest. + */ +@Immutable +public final class TextAnalysisAuthoringExportedModelManifest + implements JsonSerializable { + /* + * The model files belonging to this model. + */ + @Generated + private final List modelFiles; + + /** + * Creates an instance of TextAnalysisAuthoringExportedModelManifest class. + * + * @param modelFiles the modelFiles value to set. + */ + @Generated + private TextAnalysisAuthoringExportedModelManifest(List modelFiles) { + this.modelFiles = modelFiles; + } + + /** + * Get the modelFiles property: The model files belonging to this model. + * + * @return the modelFiles value. + */ + @Generated + public List getModelFiles() { + return this.modelFiles; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("modelFiles", this.modelFiles, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedModelManifest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedModelManifest if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedModelManifest. + */ + @Generated + public static TextAnalysisAuthoringExportedModelManifest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List modelFiles = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelFiles".equals(fieldName)) { + modelFiles = reader.readArray(reader1 -> TextAnalysisAuthoringModelFile.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringExportedModelManifest(modelFiles); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelOptions.java new file mode 100644 index 000000000000..cd0959562c3e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedModelOptions.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the options for creating or replacing an exported model. + */ +@Immutable +public final class TextAnalysisAuthoringExportedModelOptions + implements JsonSerializable { + /* + * The trained model label. + */ + @Generated + private final String trainedModelLabel; + + /** + * Creates an instance of TextAnalysisAuthoringExportedModelOptions class. + * + * @param trainedModelLabel the trainedModelLabel value to set. + */ + @Generated + public TextAnalysisAuthoringExportedModelOptions(String trainedModelLabel) { + this.trainedModelLabel = trainedModelLabel; + } + + /** + * Get the trainedModelLabel property: The trained model label. + * + * @return the trainedModelLabel value. + */ + @Generated + public String getTrainedModelLabel() { + return this.trainedModelLabel; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("trainedModelLabel", this.trainedModelLabel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedModelOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedModelOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedModelOptions. + */ + @Generated + public static TextAnalysisAuthoringExportedModelOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String trainedModelLabel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainedModelLabel".equals(fieldName)) { + trainedModelLabel = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringExportedModelOptions(trainedModelLabel); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedPrebuiltEntity.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedPrebuiltEntity.java new file mode 100644 index 000000000000..d0a2e90e9046 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedPrebuiltEntity.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents an exported prebuilt entity component. + */ +@Immutable +public final class TextAnalysisAuthoringExportedPrebuiltEntity + implements JsonSerializable { + /* + * The prebuilt entity category. + */ + @Generated + private final String category; + + /** + * Creates an instance of TextAnalysisAuthoringExportedPrebuiltEntity class. + * + * @param category the category value to set. + */ + @Generated + public TextAnalysisAuthoringExportedPrebuiltEntity(String category) { + this.category = category; + } + + /** + * Get the category property: The prebuilt entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedPrebuiltEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedPrebuiltEntity if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedPrebuiltEntity. + */ + @Generated + public static TextAnalysisAuthoringExportedPrebuiltEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String category = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringExportedPrebuiltEntity(category); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedTrainedModel.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedTrainedModel.java new file mode 100644 index 000000000000..960cd364e5f8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringExportedTrainedModel.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +/** + * Represents an exported trained model. + */ +@Immutable +public final class TextAnalysisAuthoringExportedTrainedModel + implements JsonSerializable { + /* + * The exported model name. + */ + @Generated + private String exportedModelName; + + /* + * The model ID. + */ + @Generated + private final String modelId; + + /* + * The last trained date time of the model. + */ + @Generated + private final OffsetDateTime lastTrainedDateTime; + + /* + * The last exported date time of the model. + */ + @Generated + private final OffsetDateTime lastExportedModelDateTime; + + /* + * The model expiration date. + */ + @Generated + private final LocalDate modelExpirationDate; + + /* + * The model training config version. + */ + @Generated + private final String modelTrainingConfigVersion; + + /** + * Creates an instance of TextAnalysisAuthoringExportedTrainedModel class. + * + * @param modelId the modelId value to set. + * @param lastTrainedDateTime the lastTrainedDateTime value to set. + * @param lastExportedModelDateTime the lastExportedModelDateTime value to set. + * @param modelExpirationDate the modelExpirationDate value to set. + * @param modelTrainingConfigVersion the modelTrainingConfigVersion value to set. + */ + @Generated + private TextAnalysisAuthoringExportedTrainedModel(String modelId, OffsetDateTime lastTrainedDateTime, + OffsetDateTime lastExportedModelDateTime, LocalDate modelExpirationDate, String modelTrainingConfigVersion) { + this.modelId = modelId; + this.lastTrainedDateTime = lastTrainedDateTime; + this.lastExportedModelDateTime = lastExportedModelDateTime; + this.modelExpirationDate = modelExpirationDate; + this.modelTrainingConfigVersion = modelTrainingConfigVersion; + } + + /** + * Get the exportedModelName property: The exported model name. + * + * @return the exportedModelName value. + */ + @Generated + public String getExportedModelName() { + return this.exportedModelName; + } + + /** + * Get the modelId property: The model ID. + * + * @return the modelId value. + */ + @Generated + public String getModelId() { + return this.modelId; + } + + /** + * Get the lastTrainedDateTime property: The last trained date time of the model. + * + * @return the lastTrainedDateTime value. + */ + @Generated + public OffsetDateTime getLastTrainedDateTime() { + return this.lastTrainedDateTime; + } + + /** + * Get the lastExportedModelDateTime property: The last exported date time of the model. + * + * @return the lastExportedModelDateTime value. + */ + @Generated + public OffsetDateTime getLastExportedModelDateTime() { + return this.lastExportedModelDateTime; + } + + /** + * Get the modelExpirationDate property: The model expiration date. + * + * @return the modelExpirationDate value. + */ + @Generated + public LocalDate getModelExpirationDate() { + return this.modelExpirationDate; + } + + /** + * Get the modelTrainingConfigVersion property: The model training config version. + * + * @return the modelTrainingConfigVersion value. + */ + @Generated + public String getModelTrainingConfigVersion() { + return this.modelTrainingConfigVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelId", this.modelId); + jsonWriter.writeStringField("lastTrainedDateTime", + this.lastTrainedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTrainedDateTime)); + jsonWriter.writeStringField("lastExportedModelDateTime", + this.lastExportedModelDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastExportedModelDateTime)); + jsonWriter.writeStringField("modelExpirationDate", Objects.toString(this.modelExpirationDate, null)); + jsonWriter.writeStringField("modelTrainingConfigVersion", this.modelTrainingConfigVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringExportedTrainedModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringExportedTrainedModel if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringExportedTrainedModel. + */ + @Generated + public static TextAnalysisAuthoringExportedTrainedModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String exportedModelName = null; + String modelId = null; + OffsetDateTime lastTrainedDateTime = null; + OffsetDateTime lastExportedModelDateTime = null; + LocalDate modelExpirationDate = null; + String modelTrainingConfigVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exportedModelName".equals(fieldName)) { + exportedModelName = reader.getString(); + } else if ("modelId".equals(fieldName)) { + modelId = reader.getString(); + } else if ("lastTrainedDateTime".equals(fieldName)) { + lastTrainedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastExportedModelDateTime".equals(fieldName)) { + lastExportedModelDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("modelExpirationDate".equals(fieldName)) { + modelExpirationDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("modelTrainingConfigVersion".equals(fieldName)) { + modelTrainingConfigVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringExportedTrainedModel deserializedTextAnalysisAuthoringExportedTrainedModel + = new TextAnalysisAuthoringExportedTrainedModel(modelId, lastTrainedDateTime, lastExportedModelDateTime, + modelExpirationDate, modelTrainingConfigVersion); + deserializedTextAnalysisAuthoringExportedTrainedModel.exportedModelName = exportedModelName; + + return deserializedTextAnalysisAuthoringExportedTrainedModel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringImportProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringImportProjectJobState.java new file mode 100644 index 000000000000..7d23636fed7e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringImportProjectJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of an import job. + */ +@Immutable +public final class TextAnalysisAuthoringImportProjectJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringImportProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringImportProjectJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringImportProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringImportProjectJobState if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringImportProjectJobState. + */ + @Generated + public static TextAnalysisAuthoringImportProjectJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringImportProjectJobState deserializedTextAnalysisAuthoringImportProjectJobState + = new TextAnalysisAuthoringImportProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringImportProjectJobState.jobId = jobId; + deserializedTextAnalysisAuthoringImportProjectJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringImportProjectJobState.warnings = warnings; + deserializedTextAnalysisAuthoringImportProjectJobState.errors = errors; + + return deserializedTextAnalysisAuthoringImportProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringLoadSnapshotJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringLoadSnapshotJobState.java new file mode 100644 index 000000000000..86a0334be88c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringLoadSnapshotJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of loading a snapshot job. + */ +@Immutable +public final class TextAnalysisAuthoringLoadSnapshotJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringLoadSnapshotJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringLoadSnapshotJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringLoadSnapshotJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringLoadSnapshotJobState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringLoadSnapshotJobState. + */ + @Generated + public static TextAnalysisAuthoringLoadSnapshotJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringLoadSnapshotJobState deserializedTextAnalysisAuthoringLoadSnapshotJobState + = new TextAnalysisAuthoringLoadSnapshotJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringLoadSnapshotJobState.jobId = jobId; + deserializedTextAnalysisAuthoringLoadSnapshotJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringLoadSnapshotJobState.warnings = warnings; + deserializedTextAnalysisAuthoringLoadSnapshotJobState.errors = errors; + + return deserializedTextAnalysisAuthoringLoadSnapshotJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringModelFile.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringModelFile.java new file mode 100644 index 000000000000..e8ed3e7c4887 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringModelFile.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the properties for the model file. + */ +@Immutable +public final class TextAnalysisAuthoringModelFile implements JsonSerializable { + /* + * The name of the file. + */ + @Generated + private final String name; + + /* + * The URI to retrieve the content of the file. + */ + @Generated + private final String contentUri; + + /** + * Creates an instance of TextAnalysisAuthoringModelFile class. + * + * @param name the name value to set. + * @param contentUri the contentUri value to set. + */ + @Generated + private TextAnalysisAuthoringModelFile(String name, String contentUri) { + this.name = name; + this.contentUri = contentUri; + } + + /** + * Get the name property: The name of the file. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the contentUri property: The URI to retrieve the content of the file. + * + * @return the contentUri value. + */ + @Generated + public String getContentUri() { + return this.contentUri; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("contentUri", this.contentUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringModelFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringModelFile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringModelFile. + */ + @Generated + public static TextAnalysisAuthoringModelFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String contentUri = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("contentUri".equals(fieldName)) { + contentUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringModelFile(name, contentUri); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassEvaluationSummary.java new file mode 100644 index 000000000000..145ce99bfe9d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassEvaluationSummary.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary of a class in a multi-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringMultiLabelClassEvaluationSummary + implements JsonSerializable { + /* + * Represents the model precision + */ + @Generated + private final double f1; + + /* + * Represents the model recall + */ + @Generated + private final double precision; + + /* + * Represents the model F1 score + */ + @Generated + private final double recall; + + /* + * Represents the count of true positive + */ + @Generated + private final int truePositiveCount; + + /* + * Represents the count of true negative + */ + @Generated + private final int trueNegativeCount; + + /* + * Represents the count of false positive + */ + @Generated + private final int falsePositiveCount; + + /* + * Represents the count of false negative + */ + @Generated + private final int falseNegativeCount; + + /** + * Creates an instance of TextAnalysisAuthoringMultiLabelClassEvaluationSummary class. + * + * @param f1 the f1 value to set. + * @param precision the precision value to set. + * @param recall the recall value to set. + * @param truePositiveCount the truePositiveCount value to set. + * @param trueNegativeCount the trueNegativeCount value to set. + * @param falsePositiveCount the falsePositiveCount value to set. + * @param falseNegativeCount the falseNegativeCount value to set. + */ + @Generated + private TextAnalysisAuthoringMultiLabelClassEvaluationSummary(double f1, double precision, double recall, + int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) { + this.f1 = f1; + this.precision = precision; + this.recall = recall; + this.truePositiveCount = truePositiveCount; + this.trueNegativeCount = trueNegativeCount; + this.falsePositiveCount = falsePositiveCount; + this.falseNegativeCount = falseNegativeCount; + } + + /** + * Get the f1 property: Represents the model precision. + * + * @return the f1 value. + */ + @Generated + public double getF1() { + return this.f1; + } + + /** + * Get the precision property: Represents the model recall. + * + * @return the precision value. + */ + @Generated + public double getPrecision() { + return this.precision; + } + + /** + * Get the recall property: Represents the model F1 score. + * + * @return the recall value. + */ + @Generated + public double getRecall() { + return this.recall; + } + + /** + * Get the truePositiveCount property: Represents the count of true positive. + * + * @return the truePositiveCount value. + */ + @Generated + public int getTruePositiveCount() { + return this.truePositiveCount; + } + + /** + * Get the trueNegativeCount property: Represents the count of true negative. + * + * @return the trueNegativeCount value. + */ + @Generated + public int getTrueNegativeCount() { + return this.trueNegativeCount; + } + + /** + * Get the falsePositiveCount property: Represents the count of false positive. + * + * @return the falsePositiveCount value. + */ + @Generated + public int getFalsePositiveCount() { + return this.falsePositiveCount; + } + + /** + * Get the falseNegativeCount property: Represents the count of false negative. + * + * @return the falseNegativeCount value. + */ + @Generated + public int getFalseNegativeCount() { + return this.falseNegativeCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("f1", this.f1); + jsonWriter.writeDoubleField("precision", this.precision); + jsonWriter.writeDoubleField("recall", this.recall); + jsonWriter.writeIntField("truePositiveCount", this.truePositiveCount); + jsonWriter.writeIntField("trueNegativeCount", this.trueNegativeCount); + jsonWriter.writeIntField("falsePositiveCount", this.falsePositiveCount); + jsonWriter.writeIntField("falseNegativeCount", this.falseNegativeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringMultiLabelClassEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringMultiLabelClassEvaluationSummary if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringMultiLabelClassEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringMultiLabelClassEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + double f1 = 0.0; + double precision = 0.0; + double recall = 0.0; + int truePositiveCount = 0; + int trueNegativeCount = 0; + int falsePositiveCount = 0; + int falseNegativeCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("f1".equals(fieldName)) { + f1 = reader.getDouble(); + } else if ("precision".equals(fieldName)) { + precision = reader.getDouble(); + } else if ("recall".equals(fieldName)) { + recall = reader.getDouble(); + } else if ("truePositiveCount".equals(fieldName)) { + truePositiveCount = reader.getInt(); + } else if ("trueNegativeCount".equals(fieldName)) { + trueNegativeCount = reader.getInt(); + } else if ("falsePositiveCount".equals(fieldName)) { + falsePositiveCount = reader.getInt(); + } else if ("falseNegativeCount".equals(fieldName)) { + falseNegativeCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringMultiLabelClassEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary.java new file mode 100644 index 000000000000..38a44206d765 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the evaluation summary for a multi-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary + implements JsonSerializable { + /* + * Represents the classes evaluation + */ + @Generated + private final Map classes; + + /* + * Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microF1; + + /* + * Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microPrecision; + + /* + * Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microRecall; + + /* + * Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroF1; + + /* + * Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroPrecision; + + /* + * Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroRecall; + + /** + * Creates an instance of TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary class. + * + * @param classes the classes value to set. + * @param microF1 the microF1 value to set. + * @param microPrecision the microPrecision value to set. + * @param microRecall the microRecall value to set. + * @param macroF1 the macroF1 value to set. + * @param macroPrecision the macroPrecision value to set. + * @param macroRecall the macroRecall value to set. + */ + @Generated + private TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary( + Map classes, double microF1, + double microPrecision, double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.classes = classes; + this.microF1 = microF1; + this.microPrecision = microPrecision; + this.microRecall = microRecall; + this.macroF1 = macroF1; + this.macroPrecision = macroPrecision; + this.macroRecall = macroRecall; + } + + /** + * Get the classes property: Represents the classes evaluation. + * + * @return the classes value. + */ + @Generated + public Map getClasses() { + return this.classes; + } + + /** + * Get the microF1 property: Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the microF1 value. + */ + @Generated + public double getMicroF1() { + return this.microF1; + } + + /** + * Get the microPrecision property: Represents the micro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the microPrecision value. + */ + @Generated + public double getMicroPrecision() { + return this.microPrecision; + } + + /** + * Get the microRecall property: Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the microRecall value. + */ + @Generated + public double getMicroRecall() { + return this.microRecall; + } + + /** + * Get the macroF1 property: Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroF1 value. + */ + @Generated + public double getMacroF1() { + return this.macroF1; + } + + /** + * Get the macroPrecision property: Represents the macro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the macroPrecision value. + */ + @Generated + public double getMacroPrecision() { + return this.macroPrecision; + } + + /** + * Get the macroRecall property: Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroRecall value. + */ + @Generated + public double getMacroRecall() { + return this.macroRecall; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("classes", this.classes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeDoubleField("microF1", this.microF1); + jsonWriter.writeDoubleField("microPrecision", this.microPrecision); + jsonWriter.writeDoubleField("microRecall", this.microRecall); + jsonWriter.writeDoubleField("macroF1", this.macroF1); + jsonWriter.writeDoubleField("macroPrecision", this.macroPrecision); + jsonWriter.writeDoubleField("macroRecall", this.macroRecall); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + Map classes = null; + double microF1 = 0.0; + double microPrecision = 0.0; + double microRecall = 0.0; + double macroF1 = 0.0; + double macroPrecision = 0.0; + double macroRecall = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("classes".equals(fieldName)) { + classes = reader + .readMap(reader1 -> TextAnalysisAuthoringMultiLabelClassEvaluationSummary.fromJson(reader1)); + } else if ("microF1".equals(fieldName)) { + microF1 = reader.getDouble(); + } else if ("microPrecision".equals(fieldName)) { + microPrecision = reader.getDouble(); + } else if ("microRecall".equals(fieldName)) { + microRecall = reader.getDouble(); + } else if ("macroF1".equals(fieldName)) { + macroF1 = reader.getDouble(); + } else if ("macroPrecision".equals(fieldName)) { + macroPrecision = reader.getDouble(); + } else if ("macroRecall".equals(fieldName)) { + macroRecall = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary(classes, microF1, microPrecision, + microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringPrebuiltEntity.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringPrebuiltEntity.java new file mode 100644 index 000000000000..1687f5d8838e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringPrebuiltEntity.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a supported prebuilt entity. + */ +@Immutable +public final class TextAnalysisAuthoringPrebuiltEntity + implements JsonSerializable { + /* + * The prebuilt entity category. + */ + @Generated + private String category; + + /* + * The description. + */ + @Generated + private final String description; + + /* + * English examples for the entity. + */ + @Generated + private final String examples; + + /** + * Creates an instance of TextAnalysisAuthoringPrebuiltEntity class. + * + * @param description the description value to set. + * @param examples the examples value to set. + */ + @Generated + private TextAnalysisAuthoringPrebuiltEntity(String description, String examples) { + this.description = description; + this.examples = examples; + } + + /** + * Get the category property: The prebuilt entity category. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Get the description property: The description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the examples property: English examples for the entity. + * + * @return the examples value. + */ + @Generated + public String getExamples() { + return this.examples; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("examples", this.examples); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringPrebuiltEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringPrebuiltEntity if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringPrebuiltEntity. + */ + @Generated + public static TextAnalysisAuthoringPrebuiltEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String category = null; + String description = null; + String examples = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("examples".equals(fieldName)) { + examples = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringPrebuiltEntity deserializedTextAnalysisAuthoringPrebuiltEntity + = new TextAnalysisAuthoringPrebuiltEntity(description, examples); + deserializedTextAnalysisAuthoringPrebuiltEntity.category = category; + + return deserializedTextAnalysisAuthoringPrebuiltEntity; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeletionJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeletionJobState.java new file mode 100644 index 000000000000..73790b7df902 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeletionJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a project deletion job. + */ +@Immutable +public final class TextAnalysisAuthoringProjectDeletionJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringProjectDeletionJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringProjectDeletionJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringProjectDeletionJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringProjectDeletionJobState if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringProjectDeletionJobState. + */ + @Generated + public static TextAnalysisAuthoringProjectDeletionJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringProjectDeletionJobState deserializedTextAnalysisAuthoringProjectDeletionJobState + = new TextAnalysisAuthoringProjectDeletionJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringProjectDeletionJobState.jobId = jobId; + deserializedTextAnalysisAuthoringProjectDeletionJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringProjectDeletionJobState.warnings = warnings; + deserializedTextAnalysisAuthoringProjectDeletionJobState.errors = errors; + + return deserializedTextAnalysisAuthoringProjectDeletionJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeployment.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeployment.java new file mode 100644 index 000000000000..13b8a4bd32a2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectDeployment.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Objects; + +/** + * Represents a project deployment. + */ +@Immutable +public final class TextAnalysisAuthoringProjectDeployment + implements JsonSerializable { + /* + * Represents deployment name. + */ + @Generated + private String deploymentName; + + /* + * Represents deployment modelId. + */ + @Generated + private final String modelId; + + /* + * Represents deployment last trained time. + */ + @Generated + private final OffsetDateTime lastTrainedDateTime; + + /* + * Represents deployment last deployed time. + */ + @Generated + private final OffsetDateTime lastDeployedDateTime; + + /* + * Represents deployment expiration date in the runtime. + */ + @Generated + private final LocalDate deploymentExpirationDate; + + /* + * Represents model training config version. + */ + @Generated + private final String modelTrainingConfigVersion; + + /* + * Represents the metadata of the assigned Azure resources. + */ + @Generated + private final List assignedResources; + + /** + * Creates an instance of TextAnalysisAuthoringProjectDeployment class. + * + * @param modelId the modelId value to set. + * @param lastTrainedDateTime the lastTrainedDateTime value to set. + * @param lastDeployedDateTime the lastDeployedDateTime value to set. + * @param deploymentExpirationDate the deploymentExpirationDate value to set. + * @param modelTrainingConfigVersion the modelTrainingConfigVersion value to set. + * @param assignedResources the assignedResources value to set. + */ + @Generated + private TextAnalysisAuthoringProjectDeployment(String modelId, OffsetDateTime lastTrainedDateTime, + OffsetDateTime lastDeployedDateTime, LocalDate deploymentExpirationDate, String modelTrainingConfigVersion, + List assignedResources) { + this.modelId = modelId; + this.lastTrainedDateTime = lastTrainedDateTime; + this.lastDeployedDateTime = lastDeployedDateTime; + this.deploymentExpirationDate = deploymentExpirationDate; + this.modelTrainingConfigVersion = modelTrainingConfigVersion; + this.assignedResources = assignedResources; + } + + /** + * Get the deploymentName property: Represents deployment name. + * + * @return the deploymentName value. + */ + @Generated + public String getDeploymentName() { + return this.deploymentName; + } + + /** + * Get the modelId property: Represents deployment modelId. + * + * @return the modelId value. + */ + @Generated + public String getModelId() { + return this.modelId; + } + + /** + * Get the lastTrainedDateTime property: Represents deployment last trained time. + * + * @return the lastTrainedDateTime value. + */ + @Generated + public OffsetDateTime getLastTrainedDateTime() { + return this.lastTrainedDateTime; + } + + /** + * Get the lastDeployedDateTime property: Represents deployment last deployed time. + * + * @return the lastDeployedDateTime value. + */ + @Generated + public OffsetDateTime getLastDeployedDateTime() { + return this.lastDeployedDateTime; + } + + /** + * Get the deploymentExpirationDate property: Represents deployment expiration date in the runtime. + * + * @return the deploymentExpirationDate value. + */ + @Generated + public LocalDate getDeploymentExpirationDate() { + return this.deploymentExpirationDate; + } + + /** + * Get the modelTrainingConfigVersion property: Represents model training config version. + * + * @return the modelTrainingConfigVersion value. + */ + @Generated + public String getModelTrainingConfigVersion() { + return this.modelTrainingConfigVersion; + } + + /** + * Get the assignedResources property: Represents the metadata of the assigned Azure resources. + * + * @return the assignedResources value. + */ + @Generated + public List getAssignedResources() { + return this.assignedResources; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelId", this.modelId); + jsonWriter.writeStringField("lastTrainedDateTime", + this.lastTrainedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTrainedDateTime)); + jsonWriter.writeStringField("lastDeployedDateTime", + this.lastDeployedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastDeployedDateTime)); + jsonWriter.writeStringField("deploymentExpirationDate", Objects.toString(this.deploymentExpirationDate, null)); + jsonWriter.writeStringField("modelTrainingConfigVersion", this.modelTrainingConfigVersion); + jsonWriter.writeArrayField("assignedResources", this.assignedResources, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringProjectDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringProjectDeployment if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringProjectDeployment. + */ + @Generated + public static TextAnalysisAuthoringProjectDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deploymentName = null; + String modelId = null; + OffsetDateTime lastTrainedDateTime = null; + OffsetDateTime lastDeployedDateTime = null; + LocalDate deploymentExpirationDate = null; + String modelTrainingConfigVersion = null; + List assignedResources = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentName".equals(fieldName)) { + deploymentName = reader.getString(); + } else if ("modelId".equals(fieldName)) { + modelId = reader.getString(); + } else if ("lastTrainedDateTime".equals(fieldName)) { + lastTrainedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastDeployedDateTime".equals(fieldName)) { + lastDeployedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deploymentExpirationDate".equals(fieldName)) { + deploymentExpirationDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("modelTrainingConfigVersion".equals(fieldName)) { + modelTrainingConfigVersion = reader.getString(); + } else if ("assignedResources".equals(fieldName)) { + assignedResources + = reader.readArray(reader1 -> TextAnalysisAuthoringDeploymentResource.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringProjectDeployment deserializedTextAnalysisAuthoringProjectDeployment + = new TextAnalysisAuthoringProjectDeployment(modelId, lastTrainedDateTime, lastDeployedDateTime, + deploymentExpirationDate, modelTrainingConfigVersion, assignedResources); + deserializedTextAnalysisAuthoringProjectDeployment.deploymentName = deploymentName; + + return deserializedTextAnalysisAuthoringProjectDeployment; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectMetadata.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectMetadata.java new file mode 100644 index 000000000000..63de4d175820 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectMetadata.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents the metadata of a project. + */ +@Immutable +public final class TextAnalysisAuthoringProjectMetadata + implements JsonSerializable { + /* + * Represents the project creation datetime. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * Represents the project last modification datetime. + */ + @Generated + private final OffsetDateTime lastModifiedDateTime; + + /* + * Represents the project last training datetime. + */ + @Generated + private OffsetDateTime lastTrainedDateTime; + + /* + * Represents the project last deployment datetime. + */ + @Generated + private OffsetDateTime lastDeployedDateTime; + + /* + * The project kind. + */ + @Generated + private final ProjectKind projectKind; + + /* + * The storage container name. + */ + @Generated + private final String storageInputContainerName; + + /* + * The project settings. + */ + @Generated + private ProjectSettings settings; + + /* + * The new project name. + */ + @Generated + private String projectName; + + /* + * Whether the project would be used for multiple languages or not. + */ + @Generated + private Boolean multilingual; + + /* + * The project description. + */ + @Generated + private String 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. + */ + @Generated + private final String language; + + /** + * Creates an instance of TextAnalysisAuthoringProjectMetadata class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastModifiedDateTime the lastModifiedDateTime value to set. + * @param projectKind the projectKind value to set. + * @param storageInputContainerName the storageInputContainerName value to set. + * @param language the language value to set. + */ + @Generated + private TextAnalysisAuthoringProjectMetadata(OffsetDateTime createdDateTime, OffsetDateTime lastModifiedDateTime, + ProjectKind projectKind, String storageInputContainerName, String language) { + this.createdDateTime = createdDateTime; + this.lastModifiedDateTime = lastModifiedDateTime; + this.projectKind = projectKind; + this.storageInputContainerName = storageInputContainerName; + this.language = language; + } + + /** + * Get the createdDateTime property: Represents the project creation datetime. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastModifiedDateTime property: Represents the project last modification datetime. + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastTrainedDateTime property: Represents the project last training datetime. + * + * @return the lastTrainedDateTime value. + */ + @Generated + public OffsetDateTime getLastTrainedDateTime() { + return this.lastTrainedDateTime; + } + + /** + * Get the lastDeployedDateTime property: Represents the project last deployment datetime. + * + * @return the lastDeployedDateTime value. + */ + @Generated + public OffsetDateTime getLastDeployedDateTime() { + return this.lastDeployedDateTime; + } + + /** + * Get the projectKind property: The project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the storageInputContainerName property: The storage container name. + * + * @return the storageInputContainerName value. + */ + @Generated + public String getStorageInputContainerName() { + return this.storageInputContainerName; + } + + /** + * Get the settings property: The project settings. + * + * @return the settings value. + */ + @Generated + public ProjectSettings getSettings() { + return this.settings; + } + + /** + * Get the projectName property: The new project name. + * + * @return the projectName value. + */ + @Generated + public String getProjectName() { + return this.projectName; + } + + /** + * Get the multilingual property: Whether the project would be used for multiple languages or not. + * + * @return the multilingual value. + */ + @Generated + public Boolean isMultilingual() { + return this.multilingual; + } + + /** + * Get the description property: The project description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the language property: 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. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("projectKind", this.projectKind == null ? null : this.projectKind.toString()); + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("lastTrainedDateTime", + this.lastTrainedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTrainedDateTime)); + jsonWriter.writeStringField("lastDeployedDateTime", + this.lastDeployedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastDeployedDateTime)); + jsonWriter.writeJsonField("settings", this.settings); + jsonWriter.writeBooleanField("multilingual", this.multilingual); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringProjectMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringProjectMetadata if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringProjectMetadata. + */ + @Generated + public static TextAnalysisAuthoringProjectMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime createdDateTime = null; + OffsetDateTime lastModifiedDateTime = null; + ProjectKind projectKind = null; + String storageInputContainerName = null; + String projectName = null; + String language = null; + OffsetDateTime lastTrainedDateTime = null; + OffsetDateTime lastDeployedDateTime = null; + ProjectSettings settings = null; + Boolean multilingual = null; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDateTime".equals(fieldName)) { + lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("projectKind".equals(fieldName)) { + projectKind = ProjectKind.fromString(reader.getString()); + } else if ("storageInputContainerName".equals(fieldName)) { + storageInputContainerName = reader.getString(); + } else if ("projectName".equals(fieldName)) { + projectName = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("lastTrainedDateTime".equals(fieldName)) { + lastTrainedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastDeployedDateTime".equals(fieldName)) { + lastDeployedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("settings".equals(fieldName)) { + settings = ProjectSettings.fromJson(reader); + } else if ("multilingual".equals(fieldName)) { + multilingual = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringProjectMetadata deserializedTextAnalysisAuthoringProjectMetadata + = new TextAnalysisAuthoringProjectMetadata(createdDateTime, lastModifiedDateTime, projectKind, + storageInputContainerName, language); + deserializedTextAnalysisAuthoringProjectMetadata.projectName = projectName; + deserializedTextAnalysisAuthoringProjectMetadata.lastTrainedDateTime = lastTrainedDateTime; + deserializedTextAnalysisAuthoringProjectMetadata.lastDeployedDateTime = lastDeployedDateTime; + deserializedTextAnalysisAuthoringProjectMetadata.settings = settings; + deserializedTextAnalysisAuthoringProjectMetadata.multilingual = multilingual; + deserializedTextAnalysisAuthoringProjectMetadata.description = description; + + return deserializedTextAnalysisAuthoringProjectMetadata; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectTrainedModel.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectTrainedModel.java new file mode 100644 index 000000000000..d12e92b03748 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringProjectTrainedModel.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +/** + * Represents a trained model. + */ +@Immutable +public final class TextAnalysisAuthoringProjectTrainedModel + implements JsonSerializable { + /* + * The trained model label. + */ + @Generated + private String label; + + /* + * The model ID. + */ + @Generated + private final String modelId; + + /* + * The last trained date time of the model. + */ + @Generated + private final OffsetDateTime lastTrainedDateTime; + + /* + * The duration of the model's last training request in seconds. + */ + @Generated + private final int lastTrainingDurationInSeconds; + + /* + * The model expiration date. + */ + @Generated + private final LocalDate modelExpirationDate; + + /* + * The model training config version. + */ + @Generated + private final String modelTrainingConfigVersion; + + /* + * The flag to indicate if the trained model has a snapshot ready. + */ + @Generated + private final boolean hasSnapshot; + + /** + * Creates an instance of TextAnalysisAuthoringProjectTrainedModel class. + * + * @param modelId the modelId value to set. + * @param lastTrainedDateTime the lastTrainedDateTime value to set. + * @param lastTrainingDurationInSeconds the lastTrainingDurationInSeconds value to set. + * @param modelExpirationDate the modelExpirationDate value to set. + * @param modelTrainingConfigVersion the modelTrainingConfigVersion value to set. + * @param hasSnapshot the hasSnapshot value to set. + */ + @Generated + private TextAnalysisAuthoringProjectTrainedModel(String modelId, OffsetDateTime lastTrainedDateTime, + int lastTrainingDurationInSeconds, LocalDate modelExpirationDate, String modelTrainingConfigVersion, + boolean hasSnapshot) { + this.modelId = modelId; + this.lastTrainedDateTime = lastTrainedDateTime; + this.lastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + this.modelExpirationDate = modelExpirationDate; + this.modelTrainingConfigVersion = modelTrainingConfigVersion; + this.hasSnapshot = hasSnapshot; + } + + /** + * Get the label property: The trained model label. + * + * @return the label value. + */ + @Generated + public String getLabel() { + return this.label; + } + + /** + * Get the modelId property: The model ID. + * + * @return the modelId value. + */ + @Generated + public String getModelId() { + return this.modelId; + } + + /** + * Get the lastTrainedDateTime property: The last trained date time of the model. + * + * @return the lastTrainedDateTime value. + */ + @Generated + public OffsetDateTime getLastTrainedDateTime() { + return this.lastTrainedDateTime; + } + + /** + * Get the lastTrainingDurationInSeconds property: The duration of the model's last training request in seconds. + * + * @return the lastTrainingDurationInSeconds value. + */ + @Generated + public int getLastTrainingDurationInSeconds() { + return this.lastTrainingDurationInSeconds; + } + + /** + * Get the modelExpirationDate property: The model expiration date. + * + * @return the modelExpirationDate value. + */ + @Generated + public LocalDate getModelExpirationDate() { + return this.modelExpirationDate; + } + + /** + * Get the modelTrainingConfigVersion property: The model training config version. + * + * @return the modelTrainingConfigVersion value. + */ + @Generated + public String getModelTrainingConfigVersion() { + return this.modelTrainingConfigVersion; + } + + /** + * Get the hasSnapshot property: The flag to indicate if the trained model has a snapshot ready. + * + * @return the hasSnapshot value. + */ + @Generated + public boolean isHasSnapshot() { + return this.hasSnapshot; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelId", this.modelId); + jsonWriter.writeStringField("lastTrainedDateTime", + this.lastTrainedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastTrainedDateTime)); + jsonWriter.writeIntField("lastTrainingDurationInSeconds", this.lastTrainingDurationInSeconds); + jsonWriter.writeStringField("modelExpirationDate", Objects.toString(this.modelExpirationDate, null)); + jsonWriter.writeStringField("modelTrainingConfigVersion", this.modelTrainingConfigVersion); + jsonWriter.writeBooleanField("hasSnapshot", this.hasSnapshot); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringProjectTrainedModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringProjectTrainedModel if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringProjectTrainedModel. + */ + @Generated + public static TextAnalysisAuthoringProjectTrainedModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String label = null; + String modelId = null; + OffsetDateTime lastTrainedDateTime = null; + int lastTrainingDurationInSeconds = 0; + LocalDate modelExpirationDate = null; + String modelTrainingConfigVersion = null; + boolean hasSnapshot = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("label".equals(fieldName)) { + label = reader.getString(); + } else if ("modelId".equals(fieldName)) { + modelId = reader.getString(); + } else if ("lastTrainedDateTime".equals(fieldName)) { + lastTrainedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastTrainingDurationInSeconds".equals(fieldName)) { + lastTrainingDurationInSeconds = reader.getInt(); + } else if ("modelExpirationDate".equals(fieldName)) { + modelExpirationDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("modelTrainingConfigVersion".equals(fieldName)) { + modelTrainingConfigVersion = reader.getString(); + } else if ("hasSnapshot".equals(fieldName)) { + hasSnapshot = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringProjectTrainedModel deserializedTextAnalysisAuthoringProjectTrainedModel + = new TextAnalysisAuthoringProjectTrainedModel(modelId, lastTrainedDateTime, + lastTrainingDurationInSeconds, modelExpirationDate, modelTrainingConfigVersion, hasSnapshot); + deserializedTextAnalysisAuthoringProjectTrainedModel.label = label; + + return deserializedTextAnalysisAuthoringProjectTrainedModel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSentimentEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSentimentEvaluationSummary.java new file mode 100644 index 000000000000..4e0510ded18c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSentimentEvaluationSummary.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a sentiment in a custom sentiment project. + */ +@Immutable +public final class TextAnalysisAuthoringSentimentEvaluationSummary + implements JsonSerializable { + /* + * Represents the model precision + */ + @Generated + private final double f1; + + /* + * Represents the model recall + */ + @Generated + private final double precision; + + /* + * Represents the model F1 score + */ + @Generated + private final double recall; + + /* + * Represents the count of true positive + */ + @Generated + private final int truePositiveCount; + + /* + * Represents the count of true negative + */ + @Generated + private final int trueNegativeCount; + + /* + * Represents the count of false positive + */ + @Generated + private final int falsePositiveCount; + + /* + * Represents the count of false negative + */ + @Generated + private final int falseNegativeCount; + + /** + * Creates an instance of TextAnalysisAuthoringSentimentEvaluationSummary class. + * + * @param f1 the f1 value to set. + * @param precision the precision value to set. + * @param recall the recall value to set. + * @param truePositiveCount the truePositiveCount value to set. + * @param trueNegativeCount the trueNegativeCount value to set. + * @param falsePositiveCount the falsePositiveCount value to set. + * @param falseNegativeCount the falseNegativeCount value to set. + */ + @Generated + private TextAnalysisAuthoringSentimentEvaluationSummary(double f1, double precision, double recall, + int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) { + this.f1 = f1; + this.precision = precision; + this.recall = recall; + this.truePositiveCount = truePositiveCount; + this.trueNegativeCount = trueNegativeCount; + this.falsePositiveCount = falsePositiveCount; + this.falseNegativeCount = falseNegativeCount; + } + + /** + * Get the f1 property: Represents the model precision. + * + * @return the f1 value. + */ + @Generated + public double getF1() { + return this.f1; + } + + /** + * Get the precision property: Represents the model recall. + * + * @return the precision value. + */ + @Generated + public double getPrecision() { + return this.precision; + } + + /** + * Get the recall property: Represents the model F1 score. + * + * @return the recall value. + */ + @Generated + public double getRecall() { + return this.recall; + } + + /** + * Get the truePositiveCount property: Represents the count of true positive. + * + * @return the truePositiveCount value. + */ + @Generated + public int getTruePositiveCount() { + return this.truePositiveCount; + } + + /** + * Get the trueNegativeCount property: Represents the count of true negative. + * + * @return the trueNegativeCount value. + */ + @Generated + public int getTrueNegativeCount() { + return this.trueNegativeCount; + } + + /** + * Get the falsePositiveCount property: Represents the count of false positive. + * + * @return the falsePositiveCount value. + */ + @Generated + public int getFalsePositiveCount() { + return this.falsePositiveCount; + } + + /** + * Get the falseNegativeCount property: Represents the count of false negative. + * + * @return the falseNegativeCount value. + */ + @Generated + public int getFalseNegativeCount() { + return this.falseNegativeCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("f1", this.f1); + jsonWriter.writeDoubleField("precision", this.precision); + jsonWriter.writeDoubleField("recall", this.recall); + jsonWriter.writeIntField("truePositiveCount", this.truePositiveCount); + jsonWriter.writeIntField("trueNegativeCount", this.trueNegativeCount); + jsonWriter.writeIntField("falsePositiveCount", this.falsePositiveCount); + jsonWriter.writeIntField("falseNegativeCount", this.falseNegativeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSentimentEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSentimentEvaluationSummary if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSentimentEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringSentimentEvaluationSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double f1 = 0.0; + double precision = 0.0; + double recall = 0.0; + int truePositiveCount = 0; + int trueNegativeCount = 0; + int falsePositiveCount = 0; + int falseNegativeCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("f1".equals(fieldName)) { + f1 = reader.getDouble(); + } else if ("precision".equals(fieldName)) { + precision = reader.getDouble(); + } else if ("recall".equals(fieldName)) { + recall = reader.getDouble(); + } else if ("truePositiveCount".equals(fieldName)) { + truePositiveCount = reader.getInt(); + } else if ("trueNegativeCount".equals(fieldName)) { + trueNegativeCount = reader.getInt(); + } else if ("falsePositiveCount".equals(fieldName)) { + falsePositiveCount = reader.getInt(); + } else if ("falseNegativeCount".equals(fieldName)) { + falseNegativeCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringSentimentEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassEvaluationSummary.java new file mode 100644 index 000000000000..1b0ad8de49f2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassEvaluationSummary.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a class in a single-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringSingleLabelClassEvaluationSummary + implements JsonSerializable { + /* + * Represents the model precision + */ + @Generated + private final double f1; + + /* + * Represents the model recall + */ + @Generated + private final double precision; + + /* + * Represents the model F1 score + */ + @Generated + private final double recall; + + /* + * Represents the count of true positive + */ + @Generated + private final int truePositiveCount; + + /* + * Represents the count of true negative + */ + @Generated + private final int trueNegativeCount; + + /* + * Represents the count of false positive + */ + @Generated + private final int falsePositiveCount; + + /* + * Represents the count of false negative + */ + @Generated + private final int falseNegativeCount; + + /** + * Creates an instance of TextAnalysisAuthoringSingleLabelClassEvaluationSummary class. + * + * @param f1 the f1 value to set. + * @param precision the precision value to set. + * @param recall the recall value to set. + * @param truePositiveCount the truePositiveCount value to set. + * @param trueNegativeCount the trueNegativeCount value to set. + * @param falsePositiveCount the falsePositiveCount value to set. + * @param falseNegativeCount the falseNegativeCount value to set. + */ + @Generated + private TextAnalysisAuthoringSingleLabelClassEvaluationSummary(double f1, double precision, double recall, + int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) { + this.f1 = f1; + this.precision = precision; + this.recall = recall; + this.truePositiveCount = truePositiveCount; + this.trueNegativeCount = trueNegativeCount; + this.falsePositiveCount = falsePositiveCount; + this.falseNegativeCount = falseNegativeCount; + } + + /** + * Get the f1 property: Represents the model precision. + * + * @return the f1 value. + */ + @Generated + public double getF1() { + return this.f1; + } + + /** + * Get the precision property: Represents the model recall. + * + * @return the precision value. + */ + @Generated + public double getPrecision() { + return this.precision; + } + + /** + * Get the recall property: Represents the model F1 score. + * + * @return the recall value. + */ + @Generated + public double getRecall() { + return this.recall; + } + + /** + * Get the truePositiveCount property: Represents the count of true positive. + * + * @return the truePositiveCount value. + */ + @Generated + public int getTruePositiveCount() { + return this.truePositiveCount; + } + + /** + * Get the trueNegativeCount property: Represents the count of true negative. + * + * @return the trueNegativeCount value. + */ + @Generated + public int getTrueNegativeCount() { + return this.trueNegativeCount; + } + + /** + * Get the falsePositiveCount property: Represents the count of false positive. + * + * @return the falsePositiveCount value. + */ + @Generated + public int getFalsePositiveCount() { + return this.falsePositiveCount; + } + + /** + * Get the falseNegativeCount property: Represents the count of false negative. + * + * @return the falseNegativeCount value. + */ + @Generated + public int getFalseNegativeCount() { + return this.falseNegativeCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("f1", this.f1); + jsonWriter.writeDoubleField("precision", this.precision); + jsonWriter.writeDoubleField("recall", this.recall); + jsonWriter.writeIntField("truePositiveCount", this.truePositiveCount); + jsonWriter.writeIntField("trueNegativeCount", this.trueNegativeCount); + jsonWriter.writeIntField("falsePositiveCount", this.falsePositiveCount); + jsonWriter.writeIntField("falseNegativeCount", this.falseNegativeCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSingleLabelClassEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSingleLabelClassEvaluationSummary if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSingleLabelClassEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringSingleLabelClassEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + double f1 = 0.0; + double precision = 0.0; + double recall = 0.0; + int truePositiveCount = 0; + int trueNegativeCount = 0; + int falsePositiveCount = 0; + int falseNegativeCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("f1".equals(fieldName)) { + f1 = reader.getDouble(); + } else if ("precision".equals(fieldName)) { + precision = reader.getDouble(); + } else if ("recall".equals(fieldName)) { + recall = reader.getDouble(); + } else if ("truePositiveCount".equals(fieldName)) { + truePositiveCount = reader.getInt(); + } else if ("trueNegativeCount".equals(fieldName)) { + trueNegativeCount = reader.getInt(); + } else if ("falsePositiveCount".equals(fieldName)) { + falsePositiveCount = reader.getInt(); + } else if ("falseNegativeCount".equals(fieldName)) { + falseNegativeCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringSingleLabelClassEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary.java new file mode 100644 index 000000000000..b92a0cb57f54 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the evaluation summary for a custom single-label classification project. + */ +@Immutable +public final class TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary + implements JsonSerializable { + /* + * 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. + */ + @Generated + private final TextAnalysisAuthoringConfusionMatrix confusionMatrix; + + /* + * Represents the classes evaluation + */ + @Generated + private final Map classes; + + /* + * Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microF1; + + /* + * Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microPrecision; + + /* + * Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microRecall; + + /* + * Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroF1; + + /* + * Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroPrecision; + + /* + * Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroRecall; + + /** + * Creates an instance of TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary class. + * + * @param confusionMatrix the confusionMatrix value to set. + * @param classes the classes value to set. + * @param microF1 the microF1 value to set. + * @param microPrecision the microPrecision value to set. + * @param microRecall the microRecall value to set. + * @param macroF1 the macroF1 value to set. + * @param macroPrecision the macroPrecision value to set. + * @param macroRecall the macroRecall value to set. + */ + @Generated + private TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary( + TextAnalysisAuthoringConfusionMatrix confusionMatrix, + Map classes, double microF1, + double microPrecision, double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.confusionMatrix = confusionMatrix; + this.classes = classes; + this.microF1 = microF1; + this.microPrecision = microPrecision; + this.microRecall = microRecall; + this.macroF1 = macroF1; + this.macroPrecision = macroPrecision; + this.macroRecall = macroRecall; + } + + /** + * Get the confusionMatrix property: 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. + * + * @return the confusionMatrix value. + */ + @Generated + public TextAnalysisAuthoringConfusionMatrix getConfusionMatrix() { + return this.confusionMatrix; + } + + /** + * Get the classes property: Represents the classes evaluation. + * + * @return the classes value. + */ + @Generated + public Map getClasses() { + return this.classes; + } + + /** + * Get the microF1 property: Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the microF1 value. + */ + @Generated + public double getMicroF1() { + return this.microF1; + } + + /** + * Get the microPrecision property: Represents the micro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the microPrecision value. + */ + @Generated + public double getMicroPrecision() { + return this.microPrecision; + } + + /** + * Get the microRecall property: Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the microRecall value. + */ + @Generated + public double getMicroRecall() { + return this.microRecall; + } + + /** + * Get the macroF1 property: Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroF1 value. + */ + @Generated + public double getMacroF1() { + return this.macroF1; + } + + /** + * Get the macroPrecision property: Represents the macro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the macroPrecision value. + */ + @Generated + public double getMacroPrecision() { + return this.macroPrecision; + } + + /** + * Get the macroRecall property: Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroRecall value. + */ + @Generated + public double getMacroRecall() { + return this.macroRecall; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("confusionMatrix", this.confusionMatrix); + jsonWriter.writeMapField("classes", this.classes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeDoubleField("microF1", this.microF1); + jsonWriter.writeDoubleField("microPrecision", this.microPrecision); + jsonWriter.writeDoubleField("microRecall", this.microRecall); + jsonWriter.writeDoubleField("macroF1", this.macroF1); + jsonWriter.writeDoubleField("macroPrecision", this.macroPrecision); + jsonWriter.writeDoubleField("macroRecall", this.macroRecall); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringConfusionMatrix confusionMatrix = null; + Map classes = null; + double microF1 = 0.0; + double microPrecision = 0.0; + double microRecall = 0.0; + double macroF1 = 0.0; + double macroPrecision = 0.0; + double macroRecall = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confusionMatrix".equals(fieldName)) { + confusionMatrix = TextAnalysisAuthoringConfusionMatrix.fromJson(reader); + } else if ("classes".equals(fieldName)) { + classes = reader + .readMap(reader1 -> TextAnalysisAuthoringSingleLabelClassEvaluationSummary.fromJson(reader1)); + } else if ("microF1".equals(fieldName)) { + microF1 = reader.getDouble(); + } else if ("microPrecision".equals(fieldName)) { + microPrecision = reader.getDouble(); + } else if ("microRecall".equals(fieldName)) { + microRecall = reader.getDouble(); + } else if ("macroF1".equals(fieldName)) { + macroF1 = reader.getDouble(); + } else if ("macroPrecision".equals(fieldName)) { + macroPrecision = reader.getDouble(); + } else if ("macroRecall".equals(fieldName)) { + macroRecall = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary(confusionMatrix, classes, + microF1, microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSpanSentimentEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSpanSentimentEvaluationSummary.java new file mode 100644 index 000000000000..9b056e3c93fb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSpanSentimentEvaluationSummary.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the evaluation summary for a custom sentiment project. + */ +@Immutable +public final class TextAnalysisAuthoringSpanSentimentEvaluationSummary + implements JsonSerializable { + /* + * 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. + */ + @Generated + private final TextAnalysisAuthoringConfusionMatrix confusionMatrix; + + /* + * Represents the sentiment evaluation + */ + @Generated + private final Map sentiments; + + /* + * Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microF1; + + /* + * Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microPrecision; + + /* + * Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microRecall; + + /* + * Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroF1; + + /* + * Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroPrecision; + + /* + * Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroRecall; + + /** + * Creates an instance of TextAnalysisAuthoringSpanSentimentEvaluationSummary class. + * + * @param confusionMatrix the confusionMatrix value to set. + * @param sentiments the sentiments value to set. + * @param microF1 the microF1 value to set. + * @param microPrecision the microPrecision value to set. + * @param microRecall the microRecall value to set. + * @param macroF1 the macroF1 value to set. + * @param macroPrecision the macroPrecision value to set. + * @param macroRecall the macroRecall value to set. + */ + @Generated + private TextAnalysisAuthoringSpanSentimentEvaluationSummary(TextAnalysisAuthoringConfusionMatrix confusionMatrix, + Map sentiments, double microF1, double microPrecision, + double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.confusionMatrix = confusionMatrix; + this.sentiments = sentiments; + this.microF1 = microF1; + this.microPrecision = microPrecision; + this.microRecall = microRecall; + this.macroF1 = macroF1; + this.macroPrecision = macroPrecision; + this.macroRecall = macroRecall; + } + + /** + * Get the confusionMatrix property: 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. + * + * @return the confusionMatrix value. + */ + @Generated + public TextAnalysisAuthoringConfusionMatrix getConfusionMatrix() { + return this.confusionMatrix; + } + + /** + * Get the sentiments property: Represents the sentiment evaluation. + * + * @return the sentiments value. + */ + @Generated + public Map getSentiments() { + return this.sentiments; + } + + /** + * Get the microF1 property: Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the microF1 value. + */ + @Generated + public double getMicroF1() { + return this.microF1; + } + + /** + * Get the microPrecision property: Represents the micro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the microPrecision value. + */ + @Generated + public double getMicroPrecision() { + return this.microPrecision; + } + + /** + * Get the microRecall property: Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the microRecall value. + */ + @Generated + public double getMicroRecall() { + return this.microRecall; + } + + /** + * Get the macroF1 property: Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroF1 value. + */ + @Generated + public double getMacroF1() { + return this.macroF1; + } + + /** + * Get the macroPrecision property: Represents the macro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the macroPrecision value. + */ + @Generated + public double getMacroPrecision() { + return this.macroPrecision; + } + + /** + * Get the macroRecall property: Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroRecall value. + */ + @Generated + public double getMacroRecall() { + return this.macroRecall; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("confusionMatrix", this.confusionMatrix); + jsonWriter.writeMapField("sentiments", this.sentiments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeDoubleField("microF1", this.microF1); + jsonWriter.writeDoubleField("microPrecision", this.microPrecision); + jsonWriter.writeDoubleField("microRecall", this.microRecall); + jsonWriter.writeDoubleField("macroF1", this.macroF1); + jsonWriter.writeDoubleField("macroPrecision", this.macroPrecision); + jsonWriter.writeDoubleField("macroRecall", this.macroRecall); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSpanSentimentEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSpanSentimentEvaluationSummary if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSpanSentimentEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringSpanSentimentEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringConfusionMatrix confusionMatrix = null; + Map sentiments = null; + double microF1 = 0.0; + double microPrecision = 0.0; + double microRecall = 0.0; + double macroF1 = 0.0; + double macroPrecision = 0.0; + double macroRecall = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confusionMatrix".equals(fieldName)) { + confusionMatrix = TextAnalysisAuthoringConfusionMatrix.fromJson(reader); + } else if ("sentiments".equals(fieldName)) { + sentiments + = reader.readMap(reader1 -> TextAnalysisAuthoringSentimentEvaluationSummary.fromJson(reader1)); + } else if ("microF1".equals(fieldName)) { + microF1 = reader.getDouble(); + } else if ("microPrecision".equals(fieldName)) { + microPrecision = reader.getDouble(); + } else if ("microRecall".equals(fieldName)) { + microRecall = reader.getDouble(); + } else if ("macroF1".equals(fieldName)) { + macroF1 = reader.getDouble(); + } else if ("macroPrecision".equals(fieldName)) { + macroPrecision = reader.getDouble(); + } else if ("macroRecall".equals(fieldName)) { + macroRecall = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringSpanSentimentEvaluationSummary(confusionMatrix, sentiments, microF1, + microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSubTrainingJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSubTrainingJobState.java new file mode 100644 index 000000000000..6edffca9decb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSubTrainingJobState.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents the detailed state of a training sub-operation. + */ +@Immutable +public final class TextAnalysisAuthoringSubTrainingJobState + implements JsonSerializable { + /* + * Represents progress percentage. + */ + @Generated + private final int percentComplete; + + /* + * Represents the start date time. + */ + @Generated + private OffsetDateTime startDateTime; + + /* + * Represents the end date time. + */ + @Generated + private OffsetDateTime endDateTime; + + /* + * Represents the status of the sub-operation. + */ + @Generated + private final JobStatus status; + + /** + * Creates an instance of TextAnalysisAuthoringSubTrainingJobState class. + * + * @param percentComplete the percentComplete value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringSubTrainingJobState(int percentComplete, JobStatus status) { + this.percentComplete = percentComplete; + this.status = status; + } + + /** + * Get the percentComplete property: Represents progress percentage. + * + * @return the percentComplete value. + */ + @Generated + public int getPercentComplete() { + return this.percentComplete; + } + + /** + * Get the startDateTime property: Represents the start date time. + * + * @return the startDateTime value. + */ + @Generated + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Get the endDateTime property: Represents the end date time. + * + * @return the endDateTime value. + */ + @Generated + public OffsetDateTime getEndDateTime() { + return this.endDateTime; + } + + /** + * Get the status property: Represents the status of the sub-operation. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSubTrainingJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSubTrainingJobState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSubTrainingJobState. + */ + @Generated + public static TextAnalysisAuthoringSubTrainingJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int percentComplete = 0; + JobStatus status = null; + OffsetDateTime startDateTime = null; + OffsetDateTime endDateTime = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("percentComplete".equals(fieldName)) { + percentComplete = reader.getInt(); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("startDateTime".equals(fieldName)) { + startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringSubTrainingJobState deserializedTextAnalysisAuthoringSubTrainingJobState + = new TextAnalysisAuthoringSubTrainingJobState(percentComplete, status); + deserializedTextAnalysisAuthoringSubTrainingJobState.startDateTime = startDateTime; + deserializedTextAnalysisAuthoringSubTrainingJobState.endDateTime = endDateTime; + + return deserializedTextAnalysisAuthoringSubTrainingJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSupportedLanguage.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSupportedLanguage.java new file mode 100644 index 000000000000..9acd0ee25484 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSupportedLanguage.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a supported language. + */ +@Immutable +public final class TextAnalysisAuthoringSupportedLanguage + implements JsonSerializable { + /* + * The language name. + */ + @Generated + private String languageName; + + /* + * 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. + */ + @Generated + private final String languageCode; + + /** + * Creates an instance of TextAnalysisAuthoringSupportedLanguage class. + * + * @param languageCode the languageCode value to set. + */ + @Generated + private TextAnalysisAuthoringSupportedLanguage(String languageCode) { + this.languageCode = languageCode; + } + + /** + * Get the languageName property: The language name. + * + * @return the languageName value. + */ + @Generated + public String getLanguageName() { + return this.languageName; + } + + /** + * Get the languageCode property: 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. + * + * @return the languageCode value. + */ + @Generated + public String getLanguageCode() { + return this.languageCode; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("languageCode", this.languageCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSupportedLanguage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSupportedLanguage if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSupportedLanguage. + */ + @Generated + public static TextAnalysisAuthoringSupportedLanguage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String languageName = null; + String languageCode = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("languageName".equals(fieldName)) { + languageName = reader.getString(); + } else if ("languageCode".equals(fieldName)) { + languageCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringSupportedLanguage deserializedTextAnalysisAuthoringSupportedLanguage + = new TextAnalysisAuthoringSupportedLanguage(languageCode); + deserializedTextAnalysisAuthoringSupportedLanguage.languageName = languageName; + + return deserializedTextAnalysisAuthoringSupportedLanguage; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsJobState.java new file mode 100644 index 000000000000..4425bd6b41f3 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsJobState.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a deployment job. + */ +@Immutable +public final class TextAnalysisAuthoringSwapDeploymentsJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringSwapDeploymentsJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringSwapDeploymentsJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSwapDeploymentsJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSwapDeploymentsJobState if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSwapDeploymentsJobState. + */ + @Generated + public static TextAnalysisAuthoringSwapDeploymentsJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringSwapDeploymentsJobState deserializedTextAnalysisAuthoringSwapDeploymentsJobState + = new TextAnalysisAuthoringSwapDeploymentsJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedTextAnalysisAuthoringSwapDeploymentsJobState.jobId = jobId; + deserializedTextAnalysisAuthoringSwapDeploymentsJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringSwapDeploymentsJobState.warnings = warnings; + deserializedTextAnalysisAuthoringSwapDeploymentsJobState.errors = errors; + + return deserializedTextAnalysisAuthoringSwapDeploymentsJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsOptions.java new file mode 100644 index 000000000000..9a04b1f701fb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringSwapDeploymentsOptions.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the options for swapping two deployments together. + */ +@Immutable +public final class TextAnalysisAuthoringSwapDeploymentsOptions + implements JsonSerializable { + /* + * Represents the first deployment name. + */ + @Generated + private final String firstDeploymentName; + + /* + * Represents the second deployment name. + */ + @Generated + private final String secondDeploymentName; + + /** + * Creates an instance of TextAnalysisAuthoringSwapDeploymentsOptions class. + * + * @param firstDeploymentName the firstDeploymentName value to set. + * @param secondDeploymentName the secondDeploymentName value to set. + */ + @Generated + public TextAnalysisAuthoringSwapDeploymentsOptions(String firstDeploymentName, String secondDeploymentName) { + this.firstDeploymentName = firstDeploymentName; + this.secondDeploymentName = secondDeploymentName; + } + + /** + * Get the firstDeploymentName property: Represents the first deployment name. + * + * @return the firstDeploymentName value. + */ + @Generated + public String getFirstDeploymentName() { + return this.firstDeploymentName; + } + + /** + * Get the secondDeploymentName property: Represents the second deployment name. + * + * @return the secondDeploymentName value. + */ + @Generated + public String getSecondDeploymentName() { + return this.secondDeploymentName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstDeploymentName", this.firstDeploymentName); + jsonWriter.writeStringField("secondDeploymentName", this.secondDeploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringSwapDeploymentsOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringSwapDeploymentsOptions if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringSwapDeploymentsOptions. + */ + @Generated + public static TextAnalysisAuthoringSwapDeploymentsOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String firstDeploymentName = null; + String secondDeploymentName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("firstDeploymentName".equals(fieldName)) { + firstDeploymentName = reader.getString(); + } else if ("secondDeploymentName".equals(fieldName)) { + secondDeploymentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringSwapDeploymentsOptions(firstDeploymentName, secondDeploymentName); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTextSentimentEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTextSentimentEvaluationSummary.java new file mode 100644 index 000000000000..4934546e05b4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTextSentimentEvaluationSummary.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the evaluation summary for a custom text sentiment project. + */ +@Immutable +public final class TextAnalysisAuthoringTextSentimentEvaluationSummary + implements JsonSerializable { + /* + * Represents evaluation of span level sentiments + */ + @Generated + private final TextAnalysisAuthoringSpanSentimentEvaluationSummary spanSentimentsEvaluation; + + /* + * Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microF1; + + /* + * Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microPrecision; + + /* + * Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double microRecall; + + /* + * Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroF1; + + /* + * Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroPrecision; + + /* + * Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + */ + @Generated + private final double macroRecall; + + /** + * Creates an instance of TextAnalysisAuthoringTextSentimentEvaluationSummary class. + * + * @param spanSentimentsEvaluation the spanSentimentsEvaluation value to set. + * @param microF1 the microF1 value to set. + * @param microPrecision the microPrecision value to set. + * @param microRecall the microRecall value to set. + * @param macroF1 the macroF1 value to set. + * @param macroPrecision the macroPrecision value to set. + * @param macroRecall the macroRecall value to set. + */ + @Generated + private TextAnalysisAuthoringTextSentimentEvaluationSummary( + TextAnalysisAuthoringSpanSentimentEvaluationSummary spanSentimentsEvaluation, double microF1, + double microPrecision, double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.spanSentimentsEvaluation = spanSentimentsEvaluation; + this.microF1 = microF1; + this.microPrecision = microPrecision; + this.microRecall = microRecall; + this.macroF1 = macroF1; + this.macroPrecision = macroPrecision; + this.macroRecall = macroRecall; + } + + /** + * Get the spanSentimentsEvaluation property: Represents evaluation of span level sentiments. + * + * @return the spanSentimentsEvaluation value. + */ + @Generated + public TextAnalysisAuthoringSpanSentimentEvaluationSummary getSpanSentimentsEvaluation() { + return this.spanSentimentsEvaluation; + } + + /** + * Get the microF1 property: Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the microF1 value. + */ + @Generated + public double getMicroF1() { + return this.microF1; + } + + /** + * Get the microPrecision property: Represents the micro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the microPrecision value. + */ + @Generated + public double getMicroPrecision() { + return this.microPrecision; + } + + /** + * Get the microRecall property: Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the microRecall value. + */ + @Generated + public double getMicroRecall() { + return this.microRecall; + } + + /** + * Get the macroF1 property: Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroF1 value. + */ + @Generated + public double getMacroF1() { + return this.macroF1; + } + + /** + * Get the macroPrecision property: Represents the macro precision. Expected value is a float between 0 and 1 + * inclusive. + * + * @return the macroPrecision value. + */ + @Generated + public double getMacroPrecision() { + return this.macroPrecision; + } + + /** + * Get the macroRecall property: Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + * + * @return the macroRecall value. + */ + @Generated + public double getMacroRecall() { + return this.macroRecall; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("spanSentimentsEvaluation", this.spanSentimentsEvaluation); + jsonWriter.writeDoubleField("microF1", this.microF1); + jsonWriter.writeDoubleField("microPrecision", this.microPrecision); + jsonWriter.writeDoubleField("microRecall", this.microRecall); + jsonWriter.writeDoubleField("macroF1", this.macroF1); + jsonWriter.writeDoubleField("macroPrecision", this.macroPrecision); + jsonWriter.writeDoubleField("macroRecall", this.macroRecall); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringTextSentimentEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringTextSentimentEvaluationSummary if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringTextSentimentEvaluationSummary. + */ + @Generated + public static TextAnalysisAuthoringTextSentimentEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextAnalysisAuthoringSpanSentimentEvaluationSummary spanSentimentsEvaluation = null; + double microF1 = 0.0; + double microPrecision = 0.0; + double microRecall = 0.0; + double macroF1 = 0.0; + double macroPrecision = 0.0; + double macroRecall = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("spanSentimentsEvaluation".equals(fieldName)) { + spanSentimentsEvaluation = TextAnalysisAuthoringSpanSentimentEvaluationSummary.fromJson(reader); + } else if ("microF1".equals(fieldName)) { + microF1 = reader.getDouble(); + } else if ("microPrecision".equals(fieldName)) { + microPrecision = reader.getDouble(); + } else if ("microRecall".equals(fieldName)) { + microRecall = reader.getDouble(); + } else if ("macroF1".equals(fieldName)) { + macroF1 = reader.getDouble(); + } else if ("macroPrecision".equals(fieldName)) { + macroPrecision = reader.getDouble(); + } else if ("macroRecall".equals(fieldName)) { + macroRecall = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringTextSentimentEvaluationSummary(spanSentimentsEvaluation, microF1, + microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingConfigVersion.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingConfigVersion.java new file mode 100644 index 000000000000..b39f57644284 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingConfigVersion.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Objects; + +/** + * Represents a training config version. + */ +@Immutable +public final class TextAnalysisAuthoringTrainingConfigVersion + implements JsonSerializable { + /* + * Represents the version of the config. + */ + @Generated + private String trainingConfigVersion; + + /* + * Represents the training config version expiration date. + */ + @Generated + private final LocalDate modelExpirationDate; + + /** + * Creates an instance of TextAnalysisAuthoringTrainingConfigVersion class. + * + * @param modelExpirationDate the modelExpirationDate value to set. + */ + @Generated + private TextAnalysisAuthoringTrainingConfigVersion(LocalDate modelExpirationDate) { + this.modelExpirationDate = modelExpirationDate; + } + + /** + * Get the trainingConfigVersion property: Represents the version of the config. + * + * @return the trainingConfigVersion value. + */ + @Generated + public String getTrainingConfigVersion() { + return this.trainingConfigVersion; + } + + /** + * Get the modelExpirationDate property: Represents the training config version expiration date. + * + * @return the modelExpirationDate value. + */ + @Generated + public LocalDate getModelExpirationDate() { + return this.modelExpirationDate; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelExpirationDate", Objects.toString(this.modelExpirationDate, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringTrainingConfigVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringTrainingConfigVersion if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringTrainingConfigVersion. + */ + @Generated + public static TextAnalysisAuthoringTrainingConfigVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String trainingConfigVersion = null; + LocalDate modelExpirationDate = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trainingConfigVersion".equals(fieldName)) { + trainingConfigVersion = reader.getString(); + } else if ("modelExpirationDate".equals(fieldName)) { + modelExpirationDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringTrainingConfigVersion deserializedTextAnalysisAuthoringTrainingConfigVersion + = new TextAnalysisAuthoringTrainingConfigVersion(modelExpirationDate); + deserializedTextAnalysisAuthoringTrainingConfigVersion.trainingConfigVersion = trainingConfigVersion; + + return deserializedTextAnalysisAuthoringTrainingConfigVersion; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobOptions.java new file mode 100644 index 000000000000..58de97fe8bfb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobOptions.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the options for starting a new training job. + */ +@Fluent +public final class TextAnalysisAuthoringTrainingJobOptions + implements JsonSerializable { + /* + * Represents the output model label. + */ + @Generated + private final String modelLabel; + + /* + * Represents training config version. + */ + @Generated + private final String trainingConfigVersion; + + /* + * Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage + * as 80, and testing split percentage as 20. + */ + @Generated + private TextAnalysisAuthoringEvaluationOptions evaluationOptions; + + /* + * Represents the settings for using data generation as part of training a custom model. + */ + @Generated + private DataGenerationSettings dataGenerationSettings; + + /** + * Creates an instance of TextAnalysisAuthoringTrainingJobOptions class. + * + * @param modelLabel the modelLabel value to set. + * @param trainingConfigVersion the trainingConfigVersion value to set. + */ + @Generated + public TextAnalysisAuthoringTrainingJobOptions(String modelLabel, String trainingConfigVersion) { + this.modelLabel = modelLabel; + this.trainingConfigVersion = trainingConfigVersion; + } + + /** + * Get the modelLabel property: Represents the output model label. + * + * @return the modelLabel value. + */ + @Generated + public String getModelLabel() { + return this.modelLabel; + } + + /** + * Get the trainingConfigVersion property: Represents training config version. + * + * @return the trainingConfigVersion value. + */ + @Generated + public String getTrainingConfigVersion() { + return this.trainingConfigVersion; + } + + /** + * Get the evaluationOptions property: Represents the evaluation options. By default, the evaluation kind is + * percentage, with training split percentage as 80, and testing split percentage as 20. + * + * @return the evaluationOptions value. + */ + @Generated + public TextAnalysisAuthoringEvaluationOptions getEvaluationOptions() { + return this.evaluationOptions; + } + + /** + * Set the evaluationOptions property: Represents the evaluation options. By default, the evaluation kind is + * percentage, with training split percentage as 80, and testing split percentage as 20. + * + * @param evaluationOptions the evaluationOptions value to set. + * @return the TextAnalysisAuthoringTrainingJobOptions object itself. + */ + @Generated + public TextAnalysisAuthoringTrainingJobOptions + setEvaluationOptions(TextAnalysisAuthoringEvaluationOptions evaluationOptions) { + this.evaluationOptions = evaluationOptions; + return this; + } + + /** + * Get the dataGenerationSettings property: Represents the settings for using data generation as part of training a + * custom model. + * + * @return the dataGenerationSettings value. + */ + @Generated + public DataGenerationSettings getDataGenerationSettings() { + return this.dataGenerationSettings; + } + + /** + * Set the dataGenerationSettings property: Represents the settings for using data generation as part of training a + * custom model. + * + * @param dataGenerationSettings the dataGenerationSettings value to set. + * @return the TextAnalysisAuthoringTrainingJobOptions object itself. + */ + @Generated + public TextAnalysisAuthoringTrainingJobOptions + setDataGenerationSettings(DataGenerationSettings dataGenerationSettings) { + this.dataGenerationSettings = dataGenerationSettings; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelLabel", this.modelLabel); + jsonWriter.writeStringField("trainingConfigVersion", this.trainingConfigVersion); + jsonWriter.writeJsonField("evaluationOptions", this.evaluationOptions); + jsonWriter.writeJsonField("dataGenerationSettings", this.dataGenerationSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringTrainingJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringTrainingJobOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringTrainingJobOptions. + */ + @Generated + public static TextAnalysisAuthoringTrainingJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelLabel = null; + String trainingConfigVersion = null; + TextAnalysisAuthoringEvaluationOptions evaluationOptions = null; + DataGenerationSettings dataGenerationSettings = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelLabel".equals(fieldName)) { + modelLabel = reader.getString(); + } else if ("trainingConfigVersion".equals(fieldName)) { + trainingConfigVersion = reader.getString(); + } else if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = TextAnalysisAuthoringEvaluationOptions.fromJson(reader); + } else if ("dataGenerationSettings".equals(fieldName)) { + dataGenerationSettings = DataGenerationSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringTrainingJobOptions deserializedTextAnalysisAuthoringTrainingJobOptions + = new TextAnalysisAuthoringTrainingJobOptions(modelLabel, trainingConfigVersion); + deserializedTextAnalysisAuthoringTrainingJobOptions.evaluationOptions = evaluationOptions; + deserializedTextAnalysisAuthoringTrainingJobOptions.dataGenerationSettings = dataGenerationSettings; + + return deserializedTextAnalysisAuthoringTrainingJobOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobResult.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobResult.java new file mode 100644 index 000000000000..f8cfc14821e5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobResult.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents the output of a training job. + */ +@Immutable +public final class TextAnalysisAuthoringTrainingJobResult + implements JsonSerializable { + /* + * Represents trained model label. + */ + @Generated + private final String modelLabel; + + /* + * Represents training config version. + */ + @Generated + private final String trainingConfigVersion; + + /* + * Represents model train status. + */ + @Generated + private final TextAnalysisAuthoringSubTrainingJobState trainingStatus; + + /* + * Represents model evaluation status. + */ + @Generated + private TextAnalysisAuthoringSubTrainingJobState evaluationStatus; + + /* + * Represents the estimate end date time for training and evaluation. + */ + @Generated + private OffsetDateTime estimatedEndDateTime; + + /** + * Creates an instance of TextAnalysisAuthoringTrainingJobResult class. + * + * @param modelLabel the modelLabel value to set. + * @param trainingConfigVersion the trainingConfigVersion value to set. + * @param trainingStatus the trainingStatus value to set. + */ + @Generated + private TextAnalysisAuthoringTrainingJobResult(String modelLabel, String trainingConfigVersion, + TextAnalysisAuthoringSubTrainingJobState trainingStatus) { + this.modelLabel = modelLabel; + this.trainingConfigVersion = trainingConfigVersion; + this.trainingStatus = trainingStatus; + } + + /** + * Get the modelLabel property: Represents trained model label. + * + * @return the modelLabel value. + */ + @Generated + public String getModelLabel() { + return this.modelLabel; + } + + /** + * Get the trainingConfigVersion property: Represents training config version. + * + * @return the trainingConfigVersion value. + */ + @Generated + public String getTrainingConfigVersion() { + return this.trainingConfigVersion; + } + + /** + * Get the trainingStatus property: Represents model train status. + * + * @return the trainingStatus value. + */ + @Generated + public TextAnalysisAuthoringSubTrainingJobState getTrainingStatus() { + return this.trainingStatus; + } + + /** + * Get the evaluationStatus property: Represents model evaluation status. + * + * @return the evaluationStatus value. + */ + @Generated + public TextAnalysisAuthoringSubTrainingJobState getEvaluationStatus() { + return this.evaluationStatus; + } + + /** + * Get the estimatedEndDateTime property: Represents the estimate end date time for training and evaluation. + * + * @return the estimatedEndDateTime value. + */ + @Generated + public OffsetDateTime getEstimatedEndDateTime() { + return this.estimatedEndDateTime; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelLabel", this.modelLabel); + jsonWriter.writeStringField("trainingConfigVersion", this.trainingConfigVersion); + jsonWriter.writeJsonField("trainingStatus", this.trainingStatus); + jsonWriter.writeJsonField("evaluationStatus", this.evaluationStatus); + jsonWriter.writeStringField("estimatedEndDateTime", + this.estimatedEndDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.estimatedEndDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringTrainingJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringTrainingJobResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringTrainingJobResult. + */ + @Generated + public static TextAnalysisAuthoringTrainingJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelLabel = null; + String trainingConfigVersion = null; + TextAnalysisAuthoringSubTrainingJobState trainingStatus = null; + TextAnalysisAuthoringSubTrainingJobState evaluationStatus = null; + OffsetDateTime estimatedEndDateTime = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelLabel".equals(fieldName)) { + modelLabel = reader.getString(); + } else if ("trainingConfigVersion".equals(fieldName)) { + trainingConfigVersion = reader.getString(); + } else if ("trainingStatus".equals(fieldName)) { + trainingStatus = TextAnalysisAuthoringSubTrainingJobState.fromJson(reader); + } else if ("evaluationStatus".equals(fieldName)) { + evaluationStatus = TextAnalysisAuthoringSubTrainingJobState.fromJson(reader); + } else if ("estimatedEndDateTime".equals(fieldName)) { + estimatedEndDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringTrainingJobResult deserializedTextAnalysisAuthoringTrainingJobResult + = new TextAnalysisAuthoringTrainingJobResult(modelLabel, trainingConfigVersion, trainingStatus); + deserializedTextAnalysisAuthoringTrainingJobResult.evaluationStatus = evaluationStatus; + deserializedTextAnalysisAuthoringTrainingJobResult.estimatedEndDateTime = estimatedEndDateTime; + + return deserializedTextAnalysisAuthoringTrainingJobResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobState.java new file mode 100644 index 000000000000..47e685100218 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringTrainingJobState.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a training job. + */ +@Immutable +public final class TextAnalysisAuthoringTrainingJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /* + * Represents training tasks detailed result. + */ + @Generated + private final TextAnalysisAuthoringTrainingJobResult result; + + /** + * Creates an instance of TextAnalysisAuthoringTrainingJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + * @param result the result value to set. + */ + @Generated + private TextAnalysisAuthoringTrainingJobState(OffsetDateTime createdDateTime, OffsetDateTime lastUpdatedDateTime, + JobStatus status, TextAnalysisAuthoringTrainingJobResult result) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + this.result = result; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * Get the result property: Represents training tasks detailed result. + * + * @return the result value. + */ + @Generated + public TextAnalysisAuthoringTrainingJobResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringTrainingJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringTrainingJobState if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringTrainingJobState. + */ + @Generated + public static TextAnalysisAuthoringTrainingJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + TextAnalysisAuthoringTrainingJobResult result = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("result".equals(fieldName)) { + result = TextAnalysisAuthoringTrainingJobResult.fromJson(reader); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringTrainingJobState deserializedTextAnalysisAuthoringTrainingJobState + = new TextAnalysisAuthoringTrainingJobState(createdDateTime, lastUpdatedDateTime, status, result); + deserializedTextAnalysisAuthoringTrainingJobState.jobId = jobId; + deserializedTextAnalysisAuthoringTrainingJobState.expirationDateTime = expirationDateTime; + deserializedTextAnalysisAuthoringTrainingJobState.warnings = warnings; + deserializedTextAnalysisAuthoringTrainingJobState.errors = errors; + + return deserializedTextAnalysisAuthoringTrainingJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesJobState.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesJobState.java new file mode 100644 index 000000000000..1051fc474ff8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesJobState.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents the state of a unassign deployment resources job. + */ +@Immutable +public final class TextAnalysisAuthoringUnassignDeploymentResourcesJobState + implements JsonSerializable { + /* + * The job ID. + */ + @Generated + private String jobId; + + /* + * The creation date time of the job. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * The last date time the job was updated. + */ + @Generated + private final OffsetDateTime lastUpdatedDateTime; + + /* + * The expiration date time of the job. + */ + @Generated + private OffsetDateTime expirationDateTime; + + /* + * The job status. + */ + @Generated + private final JobStatus status; + + /* + * The warnings that were encountered while executing the job. + */ + @Generated + private List warnings; + + /* + * The errors encountered while executing the job. + */ + @Generated + private List errors; + + /** + * Creates an instance of TextAnalysisAuthoringUnassignDeploymentResourcesJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private TextAnalysisAuthoringUnassignDeploymentResourcesJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status) { + this.createdDateTime = createdDateTime; + this.lastUpdatedDateTime = lastUpdatedDateTime; + this.status = status; + } + + /** + * Get the jobId property: The job ID. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the createdDateTime property: The creation date time of the job. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastUpdatedDateTime property: The last date time the job was updated. + * + * @return the lastUpdatedDateTime value. + */ + @Generated + public OffsetDateTime getLastUpdatedDateTime() { + return this.lastUpdatedDateTime; + } + + /** + * Get the expirationDateTime property: The expiration date time of the job. + * + * @return the expirationDateTime value. + */ + @Generated + public OffsetDateTime getExpirationDateTime() { + return this.expirationDateTime; + } + + /** + * Get the status property: The job status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the warnings property: The warnings that were encountered while executing the job. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the errors property: The errors encountered while executing the job. + * + * @return the errors value. + */ + @Generated + public List getErrors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringUnassignDeploymentResourcesJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringUnassignDeploymentResourcesJobState if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * TextAnalysisAuthoringUnassignDeploymentResourcesJobState. + */ + @Generated + public static TextAnalysisAuthoringUnassignDeploymentResourcesJobState fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + OffsetDateTime expirationDateTime = null; + List warnings = null; + List errors = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobId".equals(fieldName)) { + jobId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + status = JobStatus.fromString(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> TextAnalysisAuthoringWarning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + TextAnalysisAuthoringUnassignDeploymentResourcesJobState deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState + = new TextAnalysisAuthoringUnassignDeploymentResourcesJobState(createdDateTime, lastUpdatedDateTime, + status); + deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState.jobId = jobId; + deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState.expirationDateTime + = expirationDateTime; + deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState.warnings = warnings; + deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState.errors = errors; + + return deserializedTextAnalysisAuthoringUnassignDeploymentResourcesJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesOptions.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesOptions.java new file mode 100644 index 000000000000..373b11536838 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringUnassignDeploymentResourcesOptions.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the options to unassign Azure resources from a project. + */ +@Immutable +public final class TextAnalysisAuthoringUnassignDeploymentResourcesOptions + implements JsonSerializable { + /* + * Represents the assigned resource IDs to be unassigned. + */ + @Generated + private final List assignedResourceIds; + + /** + * Creates an instance of TextAnalysisAuthoringUnassignDeploymentResourcesOptions class. + * + * @param assignedResourceIds the assignedResourceIds value to set. + */ + @Generated + public TextAnalysisAuthoringUnassignDeploymentResourcesOptions(List assignedResourceIds) { + this.assignedResourceIds = assignedResourceIds; + } + + /** + * Get the assignedResourceIds property: Represents the assigned resource IDs to be unassigned. + * + * @return the assignedResourceIds value. + */ + @Generated + public List getAssignedResourceIds() { + return this.assignedResourceIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assignedResourceIds", this.assignedResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringUnassignDeploymentResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringUnassignDeploymentResourcesOptions if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringUnassignDeploymentResourcesOptions. + */ + @Generated + public static TextAnalysisAuthoringUnassignDeploymentResourcesOptions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List assignedResourceIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedResourceIds".equals(fieldName)) { + assignedResourceIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringUnassignDeploymentResourcesOptions(assignedResourceIds); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringWarning.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringWarning.java new file mode 100644 index 000000000000..7eed2cf3987a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/TextAnalysisAuthoringWarning.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a warning that was encountered while executing the request. + */ +@Immutable +public final class TextAnalysisAuthoringWarning implements JsonSerializable { + /* + * The warning code. + */ + @Generated + private final String code; + + /* + * The warning message. + */ + @Generated + private final String message; + + /** + * Creates an instance of TextAnalysisAuthoringWarning class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private TextAnalysisAuthoringWarning(String code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: The warning code. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: The warning message. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextAnalysisAuthoringWarning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextAnalysisAuthoringWarning if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TextAnalysisAuthoringWarning. + */ + @Generated + public static TextAnalysisAuthoringWarning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TextAnalysisAuthoringWarning(code, message); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/package-info.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/package-info.java new file mode 100644 index 000000000000..177645650077 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/models/package-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Authoring. + * 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>. + */ +package com.azure.ai.language.text.authoring.models; diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/package-info.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/package-info.java new file mode 100644 index 000000000000..818a1408051a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/com/azure/ai/language/text/authoring/package-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for Authoring. + * 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>. + */ +package com.azure.ai.language.text.authoring; diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/module-info.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/module-info.java new file mode 100644 index 000000000000..215255d94738 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/java/module-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.ai.language.text.authoring { + requires transitive com.azure.core; + + exports com.azure.ai.language.text.authoring; + exports com.azure.ai.language.text.authoring.models; + + opens com.azure.ai.language.text.authoring.models to com.azure.core; + opens com.azure.ai.language.text.authoring.implementation.models to com.azure.core; +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/META-INF/azure-ai-language-text-authoring_apiview_properties.json b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/META-INF/azure-ai-language-text-authoring_apiview_properties.json new file mode 100644 index 000000000000..4ac5c0db7916 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/META-INF/azure-ai-language-text-authoring_apiview_properties.json @@ -0,0 +1,294 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.language.text.authoring.AuthoringAsyncClient": "Language.Text.Authoring.TextAnalysisAuthoring", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginAssignDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.assignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginAssignDeploymentResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.assignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCancelTrainingJob": "Language.Text.Authoring.TextAnalysisAuthoring.cancelTrainingJob", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCancelTrainingJobWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.cancelTrainingJob", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCopyProject": "Language.Text.Authoring.TextAnalysisAuthoring.copyProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCopyProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.copyProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCreateOrUpdateExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginCreateOrUpdateExportedModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteDeployment": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeployment", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteDeploymentFromResources": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteDeploymentFromResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteDeploymentWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeployment", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteExportedModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteProject": "Language.Text.Authoring.TextAnalysisAuthoring.deleteProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeleteProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeployProject": "Language.Text.Authoring.TextAnalysisAuthoring.deployProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginDeployProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deployProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginEvaluateModel": "Language.Text.Authoring.TextAnalysisAuthoring.evaluateModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginEvaluateModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.evaluateModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginExport": "Language.Text.Authoring.TextAnalysisAuthoring.export", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginExportWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.export", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginImportMethod": "Language.Text.Authoring.TextAnalysisAuthoring.import", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginImportMethodWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.import", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginLoadSnapshot": "Language.Text.Authoring.TextAnalysisAuthoring.loadSnapshot", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginLoadSnapshotWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.loadSnapshot", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginSwapDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.swapDeployments", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginSwapDeploymentsWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.swapDeployments", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginTrain": "Language.Text.Authoring.TextAnalysisAuthoring.train", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginTrainWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.train", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginUnassignDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.unassignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.beginUnassignDeploymentResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.unassignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.copyProjectAuthorization": "Language.Text.Authoring.TextAnalysisAuthoring.copyProjectAuthorization", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.copyProjectAuthorizationWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.copyProjectAuthorization", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.createProject": "Language.Text.Authoring.TextAnalysisAuthoring.createProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.createProjectWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.createProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.deleteTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.deleteTrainedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.deleteTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getAssignDeploymentResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getAssignDeploymentResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getCopyProjectStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getCopyProjectStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getCopyProjectStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getCopyProjectStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeployment": "Language.Text.Authoring.TextAnalysisAuthoring.getDeployment", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeploymentDeleteFromResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeploymentDeleteFromResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeploymentStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeploymentStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getDeploymentWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeployment", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getEvaluationStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getEvaluationStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getEvaluationStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getEvaluationStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getExportStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModelJobStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModelJobStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModelManifest": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelManifest", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModelManifestWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelManifest", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getExportedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getImportStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getImportStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getImportStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getImportStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getLoadSnapshotStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getLoadSnapshotStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getModelEvaluationResults": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationResults", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getModelEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getModelEvaluationSummaryWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getProject": "Language.Text.Authoring.TextAnalysisAuthoring.getProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getProjectDeletionStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getProjectDeletionStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getProjectWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getProject", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getSupportedLanguages": "Language.Text.Authoring.TextAnalysisAuthoring.getSupportedLanguages", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getSupportedPrebuiltEntities": "Language.Text.Authoring.TextAnalysisAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getSwapDeploymentsStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getSwapDeploymentsStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getTrainedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getTrainingStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainingStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getTrainingStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainingStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getUnassignDeploymentResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.getUnassignDeploymentResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listAssignedResourceDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.listDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.listDeployments", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listExportedModels": "Language.Text.Authoring.TextAnalysisAuthoring.listExportedModels", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listProjects": "Language.Text.Authoring.TextAnalysisAuthoring.listProjects", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listTrainedModels": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainedModels", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listTrainingConfigVersions": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.text.authoring.AuthoringAsyncClient.listTrainingJobs": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainingJobs", + "com.azure.ai.language.text.authoring.AuthoringClient": "Language.Text.Authoring.TextAnalysisAuthoring", + "com.azure.ai.language.text.authoring.AuthoringClient.beginAssignDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.assignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringClient.beginAssignDeploymentResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.assignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCancelTrainingJob": "Language.Text.Authoring.TextAnalysisAuthoring.cancelTrainingJob", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCancelTrainingJobWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.cancelTrainingJob", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCopyProject": "Language.Text.Authoring.TextAnalysisAuthoring.copyProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCopyProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.copyProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCreateOrUpdateExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginCreateOrUpdateExportedModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteDeployment": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeployment", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteDeploymentFromResources": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteDeploymentFromResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteDeploymentWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteDeployment", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteExportedModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteProject": "Language.Text.Authoring.TextAnalysisAuthoring.deleteProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeleteProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeployProject": "Language.Text.Authoring.TextAnalysisAuthoring.deployProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginDeployProjectWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.deployProject", + "com.azure.ai.language.text.authoring.AuthoringClient.beginEvaluateModel": "Language.Text.Authoring.TextAnalysisAuthoring.evaluateModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginEvaluateModelWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.evaluateModel", + "com.azure.ai.language.text.authoring.AuthoringClient.beginExport": "Language.Text.Authoring.TextAnalysisAuthoring.export", + "com.azure.ai.language.text.authoring.AuthoringClient.beginExportWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.export", + "com.azure.ai.language.text.authoring.AuthoringClient.beginImportMethod": "Language.Text.Authoring.TextAnalysisAuthoring.import", + "com.azure.ai.language.text.authoring.AuthoringClient.beginImportMethodWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.import", + "com.azure.ai.language.text.authoring.AuthoringClient.beginLoadSnapshot": "Language.Text.Authoring.TextAnalysisAuthoring.loadSnapshot", + "com.azure.ai.language.text.authoring.AuthoringClient.beginLoadSnapshotWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.loadSnapshot", + "com.azure.ai.language.text.authoring.AuthoringClient.beginSwapDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.swapDeployments", + "com.azure.ai.language.text.authoring.AuthoringClient.beginSwapDeploymentsWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.swapDeployments", + "com.azure.ai.language.text.authoring.AuthoringClient.beginTrain": "Language.Text.Authoring.TextAnalysisAuthoring.train", + "com.azure.ai.language.text.authoring.AuthoringClient.beginTrainWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.train", + "com.azure.ai.language.text.authoring.AuthoringClient.beginUnassignDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.unassignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringClient.beginUnassignDeploymentResourcesWithModel": "Language.Text.Authoring.TextAnalysisAuthoring.unassignDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringClient.copyProjectAuthorization": "Language.Text.Authoring.TextAnalysisAuthoring.copyProjectAuthorization", + "com.azure.ai.language.text.authoring.AuthoringClient.copyProjectAuthorizationWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.copyProjectAuthorization", + "com.azure.ai.language.text.authoring.AuthoringClient.createProject": "Language.Text.Authoring.TextAnalysisAuthoring.createProject", + "com.azure.ai.language.text.authoring.AuthoringClient.createProjectWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.createProject", + "com.azure.ai.language.text.authoring.AuthoringClient.deleteTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoring.deleteTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.deleteTrainedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.deleteTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.getAssignDeploymentResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getAssignDeploymentResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getCopyProjectStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getCopyProjectStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getCopyProjectStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getCopyProjectStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeployment": "Language.Text.Authoring.TextAnalysisAuthoring.getDeployment", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeploymentDeleteFromResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeploymentDeleteFromResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeploymentStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeploymentStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeploymentStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getDeploymentWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getDeployment", + "com.azure.ai.language.text.authoring.AuthoringClient.getEvaluationStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getEvaluationStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getEvaluationStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getEvaluationStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getExportStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModel": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModelJobStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModelJobStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModelManifest": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelManifest", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModelManifestWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModelManifest", + "com.azure.ai.language.text.authoring.AuthoringClient.getExportedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getExportedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.getImportStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getImportStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getImportStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getImportStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getLoadSnapshotStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getLoadSnapshotStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getModelEvaluationResults": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationResults", + "com.azure.ai.language.text.authoring.AuthoringClient.getModelEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.text.authoring.AuthoringClient.getModelEvaluationSummaryWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.text.authoring.AuthoringClient.getProject": "Language.Text.Authoring.TextAnalysisAuthoring.getProject", + "com.azure.ai.language.text.authoring.AuthoringClient.getProjectDeletionStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getProjectDeletionStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getProjectWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getProject", + "com.azure.ai.language.text.authoring.AuthoringClient.getSupportedLanguages": "Language.Text.Authoring.TextAnalysisAuthoring.getSupportedLanguages", + "com.azure.ai.language.text.authoring.AuthoringClient.getSupportedPrebuiltEntities": "Language.Text.Authoring.TextAnalysisAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.text.authoring.AuthoringClient.getSwapDeploymentsStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getSwapDeploymentsStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.getTrainedModelWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainedModel", + "com.azure.ai.language.text.authoring.AuthoringClient.getTrainingStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainingStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getTrainingStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getTrainingStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getUnassignDeploymentResourcesStatus": "Language.Text.Authoring.TextAnalysisAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.getUnassignDeploymentResourcesStatusWithResponse": "Language.Text.Authoring.TextAnalysisAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.text.authoring.AuthoringClient.listAssignedResourceDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.text.authoring.AuthoringClient.listDeploymentResources": "Language.Text.Authoring.TextAnalysisAuthoring.listDeploymentResources", + "com.azure.ai.language.text.authoring.AuthoringClient.listDeployments": "Language.Text.Authoring.TextAnalysisAuthoring.listDeployments", + "com.azure.ai.language.text.authoring.AuthoringClient.listExportedModels": "Language.Text.Authoring.TextAnalysisAuthoring.listExportedModels", + "com.azure.ai.language.text.authoring.AuthoringClient.listProjects": "Language.Text.Authoring.TextAnalysisAuthoring.listProjects", + "com.azure.ai.language.text.authoring.AuthoringClient.listTrainedModels": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainedModels", + "com.azure.ai.language.text.authoring.AuthoringClient.listTrainingConfigVersions": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.text.authoring.AuthoringClient.listTrainingJobs": "Language.Text.Authoring.TextAnalysisAuthoring.listTrainingJobs", + "com.azure.ai.language.text.authoring.AuthoringClientBuilder": "Language.Text.Authoring", + "com.azure.ai.language.text.authoring.implementation.models.CopyProjectAuthorizationRequest": "Language.Text.Authoring.copyProjectAuthorization.Request.anonymous", + "com.azure.ai.language.text.authoring.models.CompositionSetting": "Language.Text.Authoring.CompositionSetting", + "com.azure.ai.language.text.authoring.models.DataGenerationConnectionInfo": "Language.Text.Authoring.TextAnalysisAuthoringDataGenerationConnectionInfo", + "com.azure.ai.language.text.authoring.models.DataGenerationSettings": "Language.Text.Authoring.TextAnalysisAuthoringDataGenerationSettings", + "com.azure.ai.language.text.authoring.models.Error": "Language.Text.Authoring.Error", + "com.azure.ai.language.text.authoring.models.ErrorCode": "Language.Text.Authoring.ErrorCode", + "com.azure.ai.language.text.authoring.models.EvaluationKind": "Language.Text.Authoring.EvaluationKind", + "com.azure.ai.language.text.authoring.models.ExportedProject": "Language.Text.Authoring.TextAnalysisAuthoringExportedProject", + "com.azure.ai.language.text.authoring.models.ExportedProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedProjectAssets", + "com.azure.ai.language.text.authoring.models.InnerErrorCode": "Language.Text.Authoring.InnerErrorCode", + "com.azure.ai.language.text.authoring.models.InnerErrorModel": "Language.Text.Authoring.InnerErrorModel", + "com.azure.ai.language.text.authoring.models.JobStatus": "Language.Text.Authoring.JobStatus", + "com.azure.ai.language.text.authoring.models.ProjectKind": "Language.Text.Authoring.ProjectKind", + "com.azure.ai.language.text.authoring.models.ProjectSettings": "Language.Text.Authoring.TextAnalysisAuthoringProjectSettings", + "com.azure.ai.language.text.authoring.models.ResourceMetadata": "Language.Text.Authoring.TextAnalysisAuthoringResourceMetadata", + "com.azure.ai.language.text.authoring.models.Sentiment": "Language.Text.Authoring.Sentiment", + "com.azure.ai.language.text.authoring.models.StringIndexType": "Language.Text.Authoring.StringIndexType", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesJobState": "Language.Text.Authoring.TextAnalysisAuthoringAssignDeploymentResourcesJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignDeploymentResourcesOptions": "Language.Text.Authoring.TextAnalysisAuthoringAssignDeploymentResourcesOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedDeploymentResource": "Language.Text.Authoring.TextAnalysisAuthoringAssignedDeploymentResource", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedProjectDeploymentMetadata": "Language.Text.Authoring.TextAnalysisAuthoringAssignedProjectDeploymentMetadata", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringAssignedProjectDeploymentsMetadata": "Language.Text.Authoring.TextAnalysisAuthoringAssignedProjectDeploymentsMetadata", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringConfusionMatrix": "Language.Text.Authoring.TextAnalysisAuthoringConfusionMatrix", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringConfusionMatrixCell": "Language.Text.Authoring.TextAnalysisAuthoringConfusionMatrixCell", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringConfusionMatrixRow": "Language.Text.Authoring.TextAnalysisAuthoringConfusionMatrixRow", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectJobState": "Language.Text.Authoring.TextAnalysisAuthoringCopyProjectJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCopyProjectOptions": "Language.Text.Authoring.TextAnalysisAuthoringCopyProjectOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateDeploymentOptions": "Language.Text.Authoring.TextAnalysisAuthoringCreateDeploymentOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCreateProjectOptions": "Language.Text.Authoring.TextAnalysisAuthoringCreateProjectOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringCustomEntityRecognitionDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringCustomEntityRecognitionEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringCustomHealthcareDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomHealthcareEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringCustomHealthcareEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringCustomMultiLabelClassificationDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringCustomMultiLabelClassificationEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringCustomSingleLabelClassificationDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringCustomSingleLabelClassificationEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringCustomTextSentimentDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringCustomTextSentimentEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringCustomTextSentimentEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeleteDeploymentOptions": "Language.Text.Authoring.TextAnalysisAuthoringDeleteDeploymentOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState": "Language.Text.Authoring.TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentJobState": "Language.Text.Authoring.TextAnalysisAuthoringDeploymentJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDeploymentResource": "Language.Text.Authoring.TextAnalysisAuthoringDeploymentResource", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEntityLabelEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentEntityLabelEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentEntityRecognitionEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEntityRegionEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentEntityRegionEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentHealthcareEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentHealthcareEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentMultiLabelClassificationEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentSentimentLabelEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentSingleLabelClassificationEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringDocumentTextSentimentEvaluationResult": "Language.Text.Authoring.TextAnalysisAuthoringDocumentTextSentimentEvaluationResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEntityEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringEntityEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEntityRecognitionEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringEntityRecognitionEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobResult": "Language.Text.Authoring.TextAnalysisAuthoringEvaluationJobResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationJobState": "Language.Text.Authoring.TextAnalysisAuthoringEvaluationJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationOptions": "Language.Text.Authoring.TextAnalysisAuthoringEvaluationOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportProjectJobState": "Language.Text.Authoring.TextAnalysisAuthoringExportProjectJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedClass": "Language.Text.Authoring.TextAnalysisAuthoringExportedClass", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCompositeEntity": "Language.Text.Authoring.TextAnalysisAuthoringExportedCompositeEntity", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomAbstractiveSummarizationDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomAbstractiveSummarizationProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomEntityRecognitionDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomEntityRecognitionDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomEntityRecognitionProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomHealthcareDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomHealthcareDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomHealthcareProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomHealthcareProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomMultiLabelClassificationDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomMultiLabelClassificationProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomSingleLabelClassificationDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomSingleLabelClassificationProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomTextSentimentDocument": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomTextSentimentDocument", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets": "Language.Text.Authoring.TextAnalysisAuthoringExportedCustomTextSentimentProjectAssets", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedDocumentClass": "Language.Text.Authoring.TextAnalysisAuthoringExportedDocumentClass", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedDocumentEntityLabel": "Language.Text.Authoring.TextAnalysisAuthoringExportedDocumentEntityLabel", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedDocumentEntityRegion": "Language.Text.Authoring.TextAnalysisAuthoringExportedDocumentEntityRegion", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedDocumentSentimentLabel": "Language.Text.Authoring.TextAnalysisAuthoringExportedDocumentSentimentLabel", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedEntity": "Language.Text.Authoring.TextAnalysisAuthoringExportedEntity", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedEntityList": "Language.Text.Authoring.TextAnalysisAuthoringExportedEntityList", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedEntityListSynonym": "Language.Text.Authoring.TextAnalysisAuthoringExportedEntityListSynonym", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedEntitySublist": "Language.Text.Authoring.TextAnalysisAuthoringExportedEntitySublist", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelJobState": "Language.Text.Authoring.TextAnalysisAuthoringExportedModelJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelManifest": "Language.Text.Authoring.TextAnalysisAuthoringExportedModelManifest", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedModelOptions": "Language.Text.Authoring.TextAnalysisAuthoringExportedModelOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedPrebuiltEntity": "Language.Text.Authoring.TextAnalysisAuthoringExportedPrebuiltEntity", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringExportedTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoringExportedTrainedModel", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringImportProjectJobState": "Language.Text.Authoring.TextAnalysisAuthoringImportProjectJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringLoadSnapshotJobState": "Language.Text.Authoring.TextAnalysisAuthoringLoadSnapshotJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringModelFile": "Language.Text.Authoring.TextAnalysisAuthoringModelFile", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringMultiLabelClassEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringMultiLabelClassEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringMultiLabelClassificationEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringPrebuiltEntity": "Language.Text.Authoring.TextAnalysisAuthoringPrebuiltEntity", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeletionJobState": "Language.Text.Authoring.TextAnalysisAuthoringProjectDeletionJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectDeployment": "Language.Text.Authoring.TextAnalysisAuthoringProjectDeployment", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectMetadata": "Language.Text.Authoring.TextAnalysisAuthoringProjectMetadata", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringProjectTrainedModel": "Language.Text.Authoring.TextAnalysisAuthoringProjectTrainedModel", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSentimentEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringSentimentEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSingleLabelClassEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringSingleLabelClassEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringSingleLabelClassificationEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSpanSentimentEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringSpanSentimentEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSubTrainingJobState": "Language.Text.Authoring.TextAnalysisAuthoringSubTrainingJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSupportedLanguage": "Language.Text.Authoring.TextAnalysisAuthoringSupportedLanguage", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsJobState": "Language.Text.Authoring.TextAnalysisAuthoringSwapDeploymentsJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringSwapDeploymentsOptions": "Language.Text.Authoring.TextAnalysisAuthoringSwapDeploymentsOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTextSentimentEvaluationSummary": "Language.Text.Authoring.TextAnalysisAuthoringTextSentimentEvaluationSummary", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingConfigVersion": "Language.Text.Authoring.TextAnalysisAuthoringTrainingConfigVersion", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobOptions": "Language.Text.Authoring.TextAnalysisAuthoringTrainingJobOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobResult": "Language.Text.Authoring.TextAnalysisAuthoringTrainingJobResult", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringTrainingJobState": "Language.Text.Authoring.TextAnalysisAuthoringTrainingJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesJobState": "Language.Text.Authoring.TextAnalysisAuthoringUnassignDeploymentResourcesJobState", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringUnassignDeploymentResourcesOptions": "Language.Text.Authoring.TextAnalysisAuthoringUnassignDeploymentResourcesOptions", + "com.azure.ai.language.text.authoring.models.TextAnalysisAuthoringWarning": "Language.Text.Authoring.TextAnalysisAuthoringWarning" + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/azure-ai-language-text-authoring.properties b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/azure-ai-language-text-authoring.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/main/resources/azure-ai-language-text-authoring.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/samples/java/com/azure/ai/language/text/authoring/ReadmeSamples.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/samples/java/com/azure/ai/language/text/authoring/ReadmeSamples.java new file mode 100644 index 000000000000..64a0413eb7af --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/samples/java/com/azure/ai/language/text/authoring/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.ai.language.text.authoring.readme + // END: com.azure.ai.language.text.authoring.readme + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/test/java/com/azure/ai/language/text/authoring/generated/AuthoringClientTestBase.java b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/test/java/com/azure/ai/language/text/authoring/generated/AuthoringClientTestBase.java new file mode 100644 index 000000000000..d9af310ec381 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/src/test/java/com/azure/ai/language/text/authoring/generated/AuthoringClientTestBase.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.language.text.authoring.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.language.text.authoring.AuthoringClient; +import com.azure.ai.language.text.authoring.AuthoringClientBuilder; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +class AuthoringClientTestBase extends TestProxyTestBase { + protected AuthoringClient authoringClient; + + @Override + protected void beforeTest() { + AuthoringClientBuilder authoringClientbuilder + = new AuthoringClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + authoringClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + authoringClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + authoringClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + authoringClient = authoringClientbuilder.buildClient(); + + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-text-authoring/tsp-location.yaml b/sdk/cognitivelanguage/azure-ai-language-text-authoring/tsp-location.yaml new file mode 100644 index 000000000000..367e7d48a5f2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-text-authoring/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeText-authoring +commit: 9bc056657f7b73ede802cee645b0aeb98c6d33cd +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/cognitivelanguage/ci.yml b/sdk/cognitivelanguage/ci.yml new file mode 100644 index 000000000000..225470a88d62 --- /dev/null +++ b/sdk/cognitivelanguage/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/cognitivelanguage/ci.yml + - sdk/cognitivelanguage/azure-ai-language-text-authoring/ + exclude: + - sdk/cognitivelanguage/pom.xml + - sdk/cognitivelanguage/azure-ai-language-text-authoring/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitivelanguage/ci.yml + - sdk/cognitivelanguage/azure-ai-language-text-authoring/ + exclude: + - sdk/cognitivelanguage/pom.xml + - sdk/cognitivelanguage/azure-ai-language-text-authoring/pom.xml + +parameters: + - name: release_azureailanguagetextauthoring + displayName: azure-ai-language-text-authoring + type: boolean + default: true + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: cognitivelanguage + Artifacts: + - name: azure-ai-language-text-authoring + groupId: com.azure + safeName: azureailanguagetextauthoring + releaseInBatch: ${{ parameters.release_azureailanguagetextauthoring }} diff --git a/sdk/cognitivelanguage/pom.xml b/sdk/cognitivelanguage/pom.xml new file mode 100644 index 000000000000..ccfa3ac68d50 --- /dev/null +++ b/sdk/cognitivelanguage/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-cognitivelanguage-service + pom + 1.0.0 + + + azure-ai-language-text-authoring + +