From 1e1868c673c4fccd05e228ba193c4a99e491c4ce Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 18 Feb 2025 19:34:58 +0000 Subject: [PATCH] CodeGen from PR 32454 in Azure/azure-rest-api-specs Merge bd3c9f623ff2e29deb022da5ddd8d0d6d8b7bb1b into 030137c4337ddfa1618ab9959c5df59f216709c1 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 16 + .../README.md | 78 + .../assets.json | 1 + .../pom.xml | 72 + .../authoring/AuthoringAsyncClient.java | 4009 +++++++ .../authoring/AuthoringClient.java | 3773 +++++++ .../authoring/AuthoringClientBuilder.java | 356 + .../authoring/AuthoringServiceVersion.java | 50 + .../AnalyzeConversationAuthoringsImpl.java | 9777 +++++++++++++++++ .../implementation/AuthoringClientImpl.java | 130 + .../implementation/JsonMergePatchHelper.java | 55 + .../OperationLocationPollingStrategy.java | 140 + .../implementation/PollingUtils.java | 151 + .../SyncOperationLocationPollingStrategy.java | 133 + .../CopyProjectAuthorizationRequest.java | 155 + .../implementation/models/package-info.java | 12 + .../implementation/package-info.java | 12 + ...oringAssignDeploymentResourcesOptions.java | 90 + ...onAuthoringAssignedDeploymentResource.java | 108 + ...ringAssignedProjectDeploymentMetadata.java | 142 + ...ingAssignedProjectDeploymentsMetadata.java | 112 + ...ngAssignedResourceDeploymentsMetadata.java | 113 + ...eConversationAuthoringConfusionMatrix.java | 91 + ...versationAuthoringConfusionMatrixCell.java | 106 + ...nversationAuthoringConfusionMatrixRow.java | 91 + ...onAuthoringConversationExportedEntity.java | 264 + ...onAuthoringConversationExportedIntent.java | 85 + ...ringConversationExportedProjectAssets.java | 188 + ...uthoringConversationExportedUtterance.java | 216 + ...versationAuthoringCopyProjectJobState.java | 229 + ...nversationAuthoringCopyProjectOptions.java | 201 + ...ationAuthoringCreateDeploymentOptions.java | 129 + ...ersationAuthoringCreateProjectOptions.java | 396 + ...ationAuthoringDeleteDeploymentOptions.java | 106 + ...DeploymentDeleteFromResourcesJobState.java | 233 + ...nversationAuthoringDeploymentJobState.java | 229 + ...nversationAuthoringDeploymentResource.java | 106 + ...nAuthoringDeploymentResourcesJobState.java | 231 + ...ionAuthoringEntitiesEvaluationSummary.java | 249 + ...ationAuthoringEntityEvaluationSummary.java | 219 + ...versationAuthoringEvaluationJobResult.java | 153 + ...nversationAuthoringEvaluationJobState.java | 252 + ...onversationAuthoringEvaluationOptions.java | 163 + ...onversationAuthoringEvaluationSummary.java | 132 + ...rsationAuthoringExportProjectJobState.java | 250 + ...ringExportedConversationOrchestration.java | 108 + ...ortedConversationOrchestrationOptions.java | 114 + ...nversationAuthoringExportedEntityList.java | 98 + ...ionAuthoringExportedEntityListSynonym.java | 131 + ...versationAuthoringExportedEntityRegex.java | 103 + ...uthoringExportedEntityRegexExpression.java | 163 + ...rsationAuthoringExportedEntitySublist.java | 129 + ...ionAuthoringExportedLuisOrchestration.java | 154 + ...oringExportedLuisOrchestrationOptions.java | 113 + ...rsationAuthoringExportedModelJobState.java | 229 + ...AuthoringExportedOrchestrationOptions.java | 120 + ...sationAuthoringExportedPrebuiltEntity.java | 85 + ...eConversationAuthoringExportedProject.java | 169 + ...rsationAuthoringExportedProjectAssets.java | 112 + ...xportedQuestionAnsweringOrchestration.java | 86 + ...QuestionAnsweringOrchestrationOptions.java | 116 + ...ersationAuthoringExportedTrainedModel.java | 211 + ...AuthoringExportedUtteranceEntityLabel.java | 130 + ...rsationAuthoringImportProjectJobState.java | 229 + ...ationAuthoringIntentEvaluationSummary.java | 219 + ...tionAuthoringIntentsEvaluationSummary.java | 249 + ...ersationAuthoringLoadSnapshotJobState.java | 229 + ...nAuthoringOrchestrationExportedIntent.java | 122 + ...ingOrchestrationExportedProjectAssets.java | 154 + ...thoringOrchestrationExportedUtterance.java | 180 + ...ConversationAuthoringPrebuiltEntities.java | 109 + ...zeConversationAuthoringPrebuiltEntity.java | 128 + ...ationAuthoringProjectDeletionJobState.java | 230 + ...onversationAuthoringProjectDeployment.java | 237 + ...eConversationAuthoringProjectMetadata.java | 321 + ...eConversationAuthoringProjectSettings.java | 148 + ...versationAuthoringProjectTrainedModel.java | 230 + ...ConversationAuthoringResourceMetadata.java | 128 + ...versationAuthoringSubTrainingJobState.java | 158 + ...onversationAuthoringSupportedLanguage.java | 108 + ...nversationAuthoringSupportedLanguages.java | 110 + ...ationAuthoringSwapDeploymentsJobState.java | 230 + ...sationAuthoringSwapDeploymentsOptions.java | 107 + ...rsationAuthoringTrainingConfigVersion.java | 110 + ...sationAuthoringTrainingConfigVersions.java | 112 + ...nversationAuthoringTrainingJobOptions.java | 182 + ...onversationAuthoringTrainingJobResult.java | 202 + ...ConversationAuthoringTrainingJobState.java | 252 + ...ingUnassignDeploymentResourcesOptions.java | 88 + ...ringUtteranceEntitiesEvaluationResult.java | 116 + ...horingUtteranceEntityEvaluationResult.java | 130 + ...ionAuthoringUtteranceEvaluationResult.java | 156 + ...oringUtteranceIntentsEvaluationResult.java | 109 + .../authoring/models/CompositionSetting.java | 72 + .../conversations/authoring/models/Error.java | 173 + .../authoring/models/ErrorCode.java | 155 + .../authoring/models/EvaluationKind.java | 57 + .../models/ExportedModelOptions.java | 83 + .../models/ExportedProjectFormat.java | 57 + .../authoring/models/InnerErrorCode.java | 129 + .../authoring/models/InnerErrorModel.java | 173 + .../authoring/models/JobStatus.java | 87 + .../OrchestrationTargetProjectKind.java | 63 + .../authoring/models/ProjectKind.java | 64 + .../authoring/models/StringIndexType.java | 52 + .../authoring/models/TrainingMode.java | 57 + .../authoring/models/Warning.java | 105 + .../authoring/models/package-info.java | 12 + .../conversations/authoring/package-info.java | 12 + .../src/main/java/module-info.java | 13 + ...rsations-authoring_apiview_properties.json | 277 + ...anguage-conversations-authoring.properties | 2 + .../authoring/ReadmeSamples.java | 12 + .../generated/AuthoringClientTestBase.java | 41 + .../tsp-location.yaml | 4 + sdk/cognitivelanguage/ci.yml | 46 + sdk/cognitivelanguage/pom.xml | 15 + 119 files changed, 33021 insertions(+) create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pom.xml create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringAsyncClient.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClient.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClientBuilder.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringServiceVersion.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AnalyzeConversationAuthoringsImpl.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AuthoringClientImpl.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/JsonMergePatchHelper.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/OperationLocationPollingStrategy.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/PollingUtils.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/SyncOperationLocationPollingStrategy.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/CopyProjectAuthorizationRequest.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/package-info.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/package-info.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignDeploymentResourcesOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedDeploymentResource.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrix.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixCell.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixRow.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedEntity.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedIntent.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedProjectAssets.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedUtterance.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateDeploymentOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateProjectOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeleteDeploymentOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResource.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResourcesJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntitiesEvaluationSummary.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntityEvaluationSummary.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationSummary.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportProjectJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestration.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestrationOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityList.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityListSynonym.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegex.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegexExpression.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntitySublist.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestration.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestrationOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedModelJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedOrchestrationOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedPrebuiltEntity.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProject.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProjectAssets.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedTrainedModel.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedUtteranceEntityLabel.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringImportProjectJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentEvaluationSummary.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentsEvaluationSummary.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringLoadSnapshotJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedIntent.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedProjectAssets.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedUtterance.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntities.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntity.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeletionJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeployment.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectMetadata.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectSettings.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectTrainedModel.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringResourceMetadata.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSubTrainingJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguage.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguages.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersion.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobState.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEvaluationResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/CompositionSetting.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Error.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ErrorCode.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/EvaluationKind.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedModelOptions.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedProjectFormat.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorCode.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorModel.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/JobStatus.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/OrchestrationTargetProjectKind.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ProjectKind.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/StringIndexType.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/TrainingMode.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Warning.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/package-info.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/package-info.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/module-info.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/META-INF/azure-ai-language-conversations-authoring_apiview_properties.json create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/azure-ai-language-conversations-authoring.properties create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/samples/java/com/azure/ai/language/conversations/authoring/ReadmeSamples.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/test/java/com/azure/ai/language/conversations/authoring/generated/AuthoringClientTestBase.java create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml create mode 100644 sdk/cognitivelanguage/ci.yml create mode 100644 sdk/cognitivelanguage/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index df67afa0183f..d35aa3b473e7 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-conversations-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-conversations-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md new file mode 100644 index 000000000000..b8868f90fcf7 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-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-conversations-authoring Java SDK. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md new file mode 100644 index 000000000000..475292ef9fc8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-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-conversations-authoring;current}) +```xml + + com.azure + azure-ai-language-conversations-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.conversations.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-conversations-authoring/assets.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json new file mode 100644 index 000000000000..05944cbdedde --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json @@ -0,0 +1 @@ +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/cognitivelanguage/azure-ai-language-conversations-authoring","Tag":""} \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pom.xml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pom.xml new file mode 100644 index 000000000000..b5342215a08b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-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-conversations-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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringAsyncClient.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringAsyncClient.java new file mode 100644 index 000000000000..27e1bacd67ae --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringAsyncClient.java @@ -0,0 +1,4009 @@ +// 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.conversations.authoring; + +import com.azure.ai.language.conversations.authoring.implementation.AnalyzeConversationAuthoringsImpl; +import com.azure.ai.language.conversations.authoring.implementation.JsonMergePatchHelper; +import com.azure.ai.language.conversations.authoring.implementation.models.CopyProjectAuthorizationRequest; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignDeploymentResourcesOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedDeploymentResource; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateDeploymentOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateProjectOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeleteDeploymentOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationSummary; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedModelJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedProject; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedTrainedModel; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringImportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringLoadSnapshotJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringPrebuiltEntities; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeletionJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeployment; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectMetadata; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectTrainedModel; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSupportedLanguages; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingConfigVersions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceEvaluationResult; +import com.azure.ai.language.conversations.authoring.models.ExportedModelOptions; +import com.azure.ai.language.conversations.authoring.models.ExportedProjectFormat; +import com.azure.ai.language.conversations.authoring.models.ProjectKind; +import com.azure.ai.language.conversations.authoring.models.StringIndexType; +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.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 AnalyzeConversationAuthoringsImpl serviceClient; + + /** + * Initializes an instance of AuthoringAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AuthoringAsyncClient(AnalyzeConversationAuthoringsImpl 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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); + } + + /** + * Creates a new project or updates an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 AnalyzeConversationAuthoringProjectDeployment 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); + } + + /** + * 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 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); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringProjectTrainedModel 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); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     entitiesEvaluation (Required): {
+     *         confusionMatrix (Required): {
+     *              (Optional): {
+     *                 String (Required): {
+     *                      (Optional): {
+     *                         String (Required): {
+     *                             normalizedValue: double (Required)
+     *                             rawValue: double (Required)
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *         entities (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     intentsEvaluation (Required): {
+     *         confusionMatrix (Required): (recursive schema, see confusionMatrix above)
+     *         intents (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     evaluationOptions (Optional): {
+     *         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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 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 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             projectName: String (Required)
+     *             deploymentsMetadata (Required): [
+     *                  (Required){
+     *                     deploymentName: String (Required)
+     *                     lastDeployedDateTime: OffsetDateTime (Required)
+     *                     deploymentExpirationDate: LocalDate (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 for deployments assigned to a resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAssignedResourceDeploymentsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listAssignedResourceDeploymentsWithResponseAsync(requestOptions); + } + + /** + * Lists the supported languages for the given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             languageName: String (Required)
+     *             languageCode: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of retrieved languages along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSupportedLanguagesWithResponse(String projectKind, + RequestOptions requestOptions) { + return this.serviceClient.getSupportedLanguagesWithResponseAsync(projectKind, requestOptions); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
languageStringNoThe language to get supported prebuilt entities for. Required + * if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" + * for English (UK), "es" for Spanish etc.
multilingualStringNoWhether to get the support prebuilt entities for + * multilingual or monolingual projects. If true, the language parameter is ignored.
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             category: String (Required)
+     *             description: String (Required)
+     *             examples: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of the retrieved supported prebuilt entities along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSupportedPrebuiltEntitiesWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getSupportedPrebuiltEntitiesWithResponseAsync(requestOptions); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             trainingConfigVersion: String (Required)
+     *             modelExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of training config versions along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTrainingConfigVersionsWithResponse(String projectKind, + RequestOptions requestOptions) { + return this.serviceClient.listTrainingConfigVersionsWithResponseAsync(projectKind, 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); + } + + /** + * 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 AnalyzeConversationAuthoringExportedTrainedModel 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); + } + + /** + * 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); + } + + /** + * 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); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringProjectMetadata 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(AnalyzeConversationAuthoringProjectMetadata.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 AnalyzeConversationAuthoringProjectMetadata 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(AnalyzeConversationAuthoringProjectMetadata.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(AnalyzeConversationAuthoringProjectMetadata.class)); + } + + /** + * Creates a new project or updates an existing one. + * + * @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, + AnalyzeConversationAuthoringCreateProjectOptions body) { + // Generated convenience method for createProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getAnalyzeConversationAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getAnalyzeConversationAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, false); + return createProjectWithResponse(projectName, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AnalyzeConversationAuthoringProjectMetadata.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(AnalyzeConversationAuthoringCopyProjectOptions.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(AnalyzeConversationAuthoringCopyProjectOptions.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, + AnalyzeConversationAuthoringCopyProjectOptions 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 exportedProjectFormat The format of the exported project file to use. + * @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, ExportedProjectFormat exportedProjectFormat, String assetKind, + String trainedModelLabel) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + if (exportedProjectFormat != null) { + requestOptions.addQueryParam("format", exportedProjectFormat.toString(), false); + } + 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 exportedProjectFormat The format of the exported project file 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 beginImportMethod(String projectName, + AnalyzeConversationAuthoringExportedProject body, ExportedProjectFormat exportedProjectFormat) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + if (exportedProjectFormat != null) { + requestOptions.addQueryParam("format", exportedProjectFormat.toString(), false); + } + 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, + AnalyzeConversationAuthoringExportedProject 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, AnalyzeConversationAuthoringTrainingJobOptions 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(AnalyzeConversationAuthoringCopyProjectJobState.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 AnalyzeConversationAuthoringProjectDeployment 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(AnalyzeConversationAuthoringProjectDeployment.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 AnalyzeConversationAuthoringProjectDeployment 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(AnalyzeConversationAuthoringProjectDeployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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, AnalyzeConversationAuthoringSwapDeploymentsOptions body) { + // Generated convenience method for beginSwapDeploymentsWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginSwapDeploymentsWithModelAsync(projectName, BinaryData.fromObject(body), + requestOptions); + } + + /** + * 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(AnalyzeConversationAuthoringProjectDeployment.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, AnalyzeConversationAuthoringCreateDeploymentOptions 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, + AnalyzeConversationAuthoringDeleteDeploymentOptions 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(AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.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(AnalyzeConversationAuthoringDeploymentJobState.class)); + } + + /** + * 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(AnalyzeConversationAuthoringSwapDeploymentsJobState.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(AnalyzeConversationAuthoringExportProjectJobState.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(AnalyzeConversationAuthoringImportProjectJobState.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 AnalyzeConversationAuthoringProjectTrainedModel 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(AnalyzeConversationAuthoringProjectTrainedModel.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 AnalyzeConversationAuthoringProjectTrainedModel 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(AnalyzeConversationAuthoringProjectTrainedModel.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(AnalyzeConversationAuthoringProjectTrainedModel.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, + AnalyzeConversationAuthoringEvaluationOptions body) { + // Generated convenience method for beginEvaluateModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginEvaluateModelWithModelAsync(projectName, trainedModelLabel, + BinaryData.fromObject(body), requestOptions); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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(AnalyzeConversationAuthoringEvaluationJobState.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(AnalyzeConversationAuthoringUtteranceEvaluationResult.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(AnalyzeConversationAuthoringUtteranceEvaluationResult.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(AnalyzeConversationAuthoringEvaluationSummary.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(AnalyzeConversationAuthoringLoadSnapshotJobState.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 AnalyzeConversationAuthoringAssignedDeploymentResource 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(AnalyzeConversationAuthoringAssignedDeploymentResource.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 AnalyzeConversationAuthoringAssignedDeploymentResource 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(AnalyzeConversationAuthoringAssignedDeploymentResource.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, AnalyzeConversationAuthoringAssignDeploymentResourcesOptions 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, AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions 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(AnalyzeConversationAuthoringDeploymentResourcesJobState.class)); + } + + /** + * Gets the status of an existing unassign deployment resources 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 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(AnalyzeConversationAuthoringDeploymentResourcesJobState.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 AnalyzeConversationAuthoringTrainingJobState 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(AnalyzeConversationAuthoringTrainingJobState.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 AnalyzeConversationAuthoringTrainingJobState 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(AnalyzeConversationAuthoringTrainingJobState.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(AnalyzeConversationAuthoringTrainingJobState.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(AnalyzeConversationAuthoringProjectDeletionJobState.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 maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 for deployments assigned to a resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + listAssignedResourceDeployments(Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for listAssignedResourceDeploymentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return listAssignedResourceDeploymentsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.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 represents the metadata for deployments assigned to a resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAssignedResourceDeployments() { + // Generated convenience method for listAssignedResourceDeploymentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listAssignedResourceDeploymentsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.class)); + } + + /** + * Lists the supported languages for the given project type. + * + * @param projectKind The project kind. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of retrieved languages on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSupportedLanguages(ProjectKind projectKind, + Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for getSupportedLanguagesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getSupportedLanguagesWithResponse(projectKind.toString(), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringSupportedLanguages.class)); + } + + /** + * Lists the supported languages for the given project type. + * + * @param projectKind 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 a list of retrieved languages on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSupportedLanguages(ProjectKind projectKind) { + // Generated convenience method for getSupportedLanguagesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSupportedLanguagesWithResponse(projectKind.toString(), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringSupportedLanguages.class)); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + * + * @param language The language to get supported prebuilt entities for. Required if multilingual is false. This is + * BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for + * Spanish etc. + * @param multilingual Whether to get the support prebuilt entities for multilingual or monolingual projects. If + * true, the language parameter is ignored. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of the retrieved supported prebuilt entities on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSupportedPrebuiltEntities(String language, + String multilingual, Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for getSupportedPrebuiltEntitiesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (language != null) { + requestOptions.addQueryParam("language", language, false); + } + if (multilingual != null) { + requestOptions.addQueryParam("multilingual", multilingual, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getSupportedPrebuiltEntitiesWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AnalyzeConversationAuthoringPrebuiltEntities.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 represents a list of the retrieved supported prebuilt entities on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSupportedPrebuiltEntities() { + // Generated convenience method for getSupportedPrebuiltEntitiesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSupportedPrebuiltEntitiesWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AnalyzeConversationAuthoringPrebuiltEntities.class)); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind The project kind. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of training config versions on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listTrainingConfigVersions(ProjectKind projectKind, + Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for listTrainingConfigVersionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return listTrainingConfigVersionsWithResponse(projectKind.toString(), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringTrainingConfigVersions.class)); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind 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 a list of training config versions on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + listTrainingConfigVersions(ProjectKind projectKind) { + // Generated convenience method for listTrainingConfigVersionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listTrainingConfigVersionsWithResponse(projectKind.toString(), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData + .toObject(AnalyzeConversationAuthoringTrainingConfigVersions.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 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(AnalyzeConversationAuthoringExportedTrainedModel.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 AnalyzeConversationAuthoringExportedTrainedModel 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(AnalyzeConversationAuthoringExportedTrainedModel.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 AnalyzeConversationAuthoringExportedTrainedModel 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(AnalyzeConversationAuthoringExportedTrainedModel.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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); + } + + /** + * 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, ExportedModelOptions body) { + // Generated convenience method for beginCreateOrUpdateExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrUpdateExportedModelWithModelAsync(projectName, exportedModelName, + BinaryData.fromObject(body), 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(AnalyzeConversationAuthoringExportedModelJobState.class)); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClient.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClient.java new file mode 100644 index 000000000000..97f8a908cbee --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClient.java @@ -0,0 +1,3773 @@ +// 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.conversations.authoring; + +import com.azure.ai.language.conversations.authoring.implementation.AnalyzeConversationAuthoringsImpl; +import com.azure.ai.language.conversations.authoring.implementation.JsonMergePatchHelper; +import com.azure.ai.language.conversations.authoring.implementation.models.CopyProjectAuthorizationRequest; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignDeploymentResourcesOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedDeploymentResource; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateDeploymentOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateProjectOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeleteDeploymentOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationSummary; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedModelJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedProject; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedTrainedModel; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringImportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringLoadSnapshotJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringPrebuiltEntities; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeletionJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeployment; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectMetadata; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectTrainedModel; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSupportedLanguages; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingConfigVersions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceEvaluationResult; +import com.azure.ai.language.conversations.authoring.models.ExportedModelOptions; +import com.azure.ai.language.conversations.authoring.models.ExportedProjectFormat; +import com.azure.ai.language.conversations.authoring.models.ProjectKind; +import com.azure.ai.language.conversations.authoring.models.StringIndexType; +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.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 AnalyzeConversationAuthoringsImpl serviceClient; + + /** + * Initializes an instance of AuthoringClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AuthoringClient(AnalyzeConversationAuthoringsImpl 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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); + } + + /** + * Creates a new project or updates an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 AnalyzeConversationAuthoringProjectDeployment 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); + } + + /** + * 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 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); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringProjectTrainedModel 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); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     entitiesEvaluation (Required): {
+     *         confusionMatrix (Required): {
+     *              (Optional): {
+     *                 String (Required): {
+     *                      (Optional): {
+     *                         String (Required): {
+     *                             normalizedValue: double (Required)
+     *                             rawValue: double (Required)
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *         entities (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     intentsEvaluation (Required): {
+     *         confusionMatrix (Required): (recursive schema, see confusionMatrix above)
+     *         intents (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     evaluationOptions (Optional): {
+     *         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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 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 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             projectName: String (Required)
+     *             deploymentsMetadata (Required): [
+     *                  (Required){
+     *                     deploymentName: String (Required)
+     *                     lastDeployedDateTime: OffsetDateTime (Required)
+     *                     deploymentExpirationDate: LocalDate (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 for deployments assigned to a resource along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAssignedResourceDeploymentsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listAssignedResourceDeploymentsWithResponse(requestOptions); + } + + /** + * Lists the supported languages for the given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             languageName: String (Required)
+     *             languageCode: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of retrieved languages along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedLanguagesWithResponse(String projectKind, RequestOptions requestOptions) { + return this.serviceClient.getSupportedLanguagesWithResponse(projectKind, requestOptions); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
languageStringNoThe language to get supported prebuilt entities for. Required + * if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" + * for English (UK), "es" for Spanish etc.
multilingualStringNoWhether to get the support prebuilt entities for + * multilingual or monolingual projects. If true, the language parameter is ignored.
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             category: String (Required)
+     *             description: String (Required)
+     *             examples: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of the retrieved supported prebuilt entities along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedPrebuiltEntitiesWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getSupportedPrebuiltEntitiesWithResponse(requestOptions); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             trainingConfigVersion: String (Required)
+     *             modelExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of training config versions along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTrainingConfigVersionsWithResponse(String projectKind, + RequestOptions requestOptions) { + return this.serviceClient.listTrainingConfigVersionsWithResponse(projectKind, 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); + } + + /** + * 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 AnalyzeConversationAuthoringExportedTrainedModel 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); + } + + /** + * 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); + } + + /** + * 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); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringProjectMetadata 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(AnalyzeConversationAuthoringProjectMetadata.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 AnalyzeConversationAuthoringProjectMetadata 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(AnalyzeConversationAuthoringProjectMetadata.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 AnalyzeConversationAuthoringProjectMetadata getProject(String projectName) { + // Generated convenience method for getProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectWithResponse(projectName, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringProjectMetadata.class); + } + + /** + * Creates a new project or updates an existing one. + * + * @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 AnalyzeConversationAuthoringProjectMetadata createProject(String projectName, + AnalyzeConversationAuthoringCreateProjectOptions body) { + // Generated convenience method for createProjectWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getAnalyzeConversationAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getAnalyzeConversationAuthoringCreateProjectOptionsAccessor() + .prepareModelForJsonMergePatch(body, false); + return createProjectWithResponse(projectName, bodyInBinaryData, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringProjectMetadata.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 AnalyzeConversationAuthoringCopyProjectOptions 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(AnalyzeConversationAuthoringCopyProjectOptions.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 AnalyzeConversationAuthoringCopyProjectOptions 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(AnalyzeConversationAuthoringCopyProjectOptions.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, + AnalyzeConversationAuthoringCopyProjectOptions 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 exportedProjectFormat The format of the exported project file to use. + * @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, ExportedProjectFormat exportedProjectFormat, String assetKind, + String trainedModelLabel) { + // Generated convenience method for beginExportWithModel + RequestOptions requestOptions = new RequestOptions(); + if (exportedProjectFormat != null) { + requestOptions.addQueryParam("format", exportedProjectFormat.toString(), false); + } + 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 exportedProjectFormat The format of the exported project file 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 beginImportMethod(String projectName, + AnalyzeConversationAuthoringExportedProject body, ExportedProjectFormat exportedProjectFormat) { + // Generated convenience method for beginImportMethodWithModel + RequestOptions requestOptions = new RequestOptions(); + if (exportedProjectFormat != null) { + requestOptions.addQueryParam("format", exportedProjectFormat.toString(), false); + } + 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, + AnalyzeConversationAuthoringExportedProject 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, AnalyzeConversationAuthoringTrainingJobOptions 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 AnalyzeConversationAuthoringCopyProjectJobState getCopyProjectStatus(String projectName, String jobId) { + // Generated convenience method for getCopyProjectStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCopyProjectStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringCopyProjectJobState.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 AnalyzeConversationAuthoringProjectDeployment 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(AnalyzeConversationAuthoringProjectDeployment.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 AnalyzeConversationAuthoringProjectDeployment 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(AnalyzeConversationAuthoringProjectDeployment.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, AnalyzeConversationAuthoringSwapDeploymentsOptions body) { + // Generated convenience method for beginSwapDeploymentsWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginSwapDeploymentsWithModel(projectName, BinaryData.fromObject(body), requestOptions); + } + + /** + * 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 AnalyzeConversationAuthoringProjectDeployment getDeployment(String projectName, String deploymentName) { + // Generated convenience method for getDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentWithResponse(projectName, deploymentName, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringProjectDeployment.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, AnalyzeConversationAuthoringCreateDeploymentOptions 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, + AnalyzeConversationAuthoringDeleteDeploymentOptions 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 AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState + getDeploymentDeleteFromResourcesStatus(String projectName, String deploymentName, String jobId) { + // Generated convenience method for getDeploymentDeleteFromResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentDeleteFromResourcesStatusWithResponse(projectName, deploymentName, jobId, requestOptions) + .getValue() + .toObject(AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.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 AnalyzeConversationAuthoringDeploymentJobState getDeploymentStatus(String projectName, String deploymentName, + String jobId) { + // Generated convenience method for getDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentStatusWithResponse(projectName, deploymentName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringDeploymentJobState.class); + } + + /** + * 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 AnalyzeConversationAuthoringSwapDeploymentsJobState getSwapDeploymentsStatus(String projectName, + String jobId) { + // Generated convenience method for getSwapDeploymentsStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSwapDeploymentsStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringSwapDeploymentsJobState.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 AnalyzeConversationAuthoringExportProjectJobState getExportStatus(String projectName, String jobId) { + // Generated convenience method for getExportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringExportProjectJobState.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 AnalyzeConversationAuthoringImportProjectJobState getImportStatus(String projectName, String jobId) { + // Generated convenience method for getImportStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getImportStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringImportProjectJobState.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 AnalyzeConversationAuthoringProjectTrainedModel 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(AnalyzeConversationAuthoringProjectTrainedModel.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 AnalyzeConversationAuthoringProjectTrainedModel 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(AnalyzeConversationAuthoringProjectTrainedModel.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 AnalyzeConversationAuthoringProjectTrainedModel getTrainedModel(String projectName, + String trainedModelLabel) { + // Generated convenience method for getTrainedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainedModelWithResponse(projectName, trainedModelLabel, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringProjectTrainedModel.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, + AnalyzeConversationAuthoringEvaluationOptions body) { + // Generated convenience method for beginEvaluateModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginEvaluateModelWithModel(projectName, trainedModelLabel, BinaryData.fromObject(body), + requestOptions); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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 AnalyzeConversationAuthoringEvaluationJobState getEvaluationStatus(String projectName, + String trainedModelLabel, String jobId) { + // Generated convenience method for getEvaluationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEvaluationStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringEvaluationJobState.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(AnalyzeConversationAuthoringUtteranceEvaluationResult.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(AnalyzeConversationAuthoringUtteranceEvaluationResult.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 AnalyzeConversationAuthoringEvaluationSummary getModelEvaluationSummary(String projectName, + String trainedModelLabel) { + // Generated convenience method for getModelEvaluationSummaryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelEvaluationSummaryWithResponse(projectName, trainedModelLabel, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringEvaluationSummary.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 AnalyzeConversationAuthoringLoadSnapshotJobState getLoadSnapshotStatus(String projectName, + String trainedModelLabel, String jobId) { + // Generated convenience method for getLoadSnapshotStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLoadSnapshotStatusWithResponse(projectName, trainedModelLabel, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringLoadSnapshotJobState.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 AnalyzeConversationAuthoringAssignedDeploymentResource 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(AnalyzeConversationAuthoringAssignedDeploymentResource.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 AnalyzeConversationAuthoringAssignedDeploymentResource 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(AnalyzeConversationAuthoringAssignedDeploymentResource.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, AnalyzeConversationAuthoringAssignDeploymentResourcesOptions 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, AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions 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 AnalyzeConversationAuthoringDeploymentResourcesJobState + getAssignDeploymentResourcesStatus(String projectName, String jobId) { + // Generated convenience method for getAssignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAssignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringDeploymentResourcesJobState.class); + } + + /** + * Gets the status of an existing unassign deployment resources 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 status of an existing unassign deployment resources job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringDeploymentResourcesJobState + getUnassignDeploymentResourcesStatus(String projectName, String jobId) { + // Generated convenience method for getUnassignDeploymentResourcesStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUnassignDeploymentResourcesStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringDeploymentResourcesJobState.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 AnalyzeConversationAuthoringTrainingJobState 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(AnalyzeConversationAuthoringTrainingJobState.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 AnalyzeConversationAuthoringTrainingJobState 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(AnalyzeConversationAuthoringTrainingJobState.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 AnalyzeConversationAuthoringTrainingJobState getTrainingStatus(String projectName, String jobId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(projectName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringTrainingJobState.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 AnalyzeConversationAuthoringProjectDeletionJobState getProjectDeletionStatus(String jobId) { + // Generated convenience method for getProjectDeletionStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getProjectDeletionStatusWithResponse(jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringProjectDeletionJobState.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 maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 for deployments assigned to a resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata listAssignedResourceDeployments(Integer top, + Integer skip, Integer maxPageSize) { + // Generated convenience method for listAssignedResourceDeploymentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return listAssignedResourceDeploymentsWithResponse(requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.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 represents the metadata for deployments assigned to a resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata listAssignedResourceDeployments() { + // Generated convenience method for listAssignedResourceDeploymentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listAssignedResourceDeploymentsWithResponse(requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.class); + } + + /** + * Lists the supported languages for the given project type. + * + * @param projectKind The project kind. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of retrieved languages. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringSupportedLanguages getSupportedLanguages(ProjectKind projectKind, Integer top, + Integer skip, Integer maxPageSize) { + // Generated convenience method for getSupportedLanguagesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getSupportedLanguagesWithResponse(projectKind.toString(), requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringSupportedLanguages.class); + } + + /** + * Lists the supported languages for the given project type. + * + * @param projectKind 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 a list of retrieved languages. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringSupportedLanguages getSupportedLanguages(ProjectKind projectKind) { + // Generated convenience method for getSupportedLanguagesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSupportedLanguagesWithResponse(projectKind.toString(), requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringSupportedLanguages.class); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + * + * @param language The language to get supported prebuilt entities for. Required if multilingual is false. This is + * BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for + * Spanish etc. + * @param multilingual Whether to get the support prebuilt entities for multilingual or monolingual projects. If + * true, the language parameter is ignored. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of the retrieved supported prebuilt entities. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringPrebuiltEntities getSupportedPrebuiltEntities(String language, + String multilingual, Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for getSupportedPrebuiltEntitiesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (language != null) { + requestOptions.addQueryParam("language", language, false); + } + if (multilingual != null) { + requestOptions.addQueryParam("multilingual", multilingual, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return getSupportedPrebuiltEntitiesWithResponse(requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringPrebuiltEntities.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 represents a list of the retrieved supported prebuilt entities. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringPrebuiltEntities getSupportedPrebuiltEntities() { + // Generated convenience method for getSupportedPrebuiltEntitiesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSupportedPrebuiltEntitiesWithResponse(requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringPrebuiltEntities.class); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind The project kind. + * @param top The maximum number of resources to return from the collection. + * @param skip An offset into the collection of the first resource to be returned. + * @param maxPageSize The maximum number of resources to include in a single response. + * @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 a list of training config versions. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringTrainingConfigVersions listTrainingConfigVersions(ProjectKind projectKind, + Integer top, Integer skip, Integer maxPageSize) { + // Generated convenience method for listTrainingConfigVersionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (skip != null) { + requestOptions.addQueryParam("skip", String.valueOf(skip), false); + } + if (maxPageSize != null) { + requestOptions.addQueryParam("maxpagesize", String.valueOf(maxPageSize), false); + } + return listTrainingConfigVersionsWithResponse(projectKind.toString(), requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringTrainingConfigVersions.class); + } + + /** + * Lists the support training config version for a given project type. + * + * @param projectKind 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 a list of training config versions. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalyzeConversationAuthoringTrainingConfigVersions listTrainingConfigVersions(ProjectKind projectKind) { + // Generated convenience method for listTrainingConfigVersionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listTrainingConfigVersionsWithResponse(projectKind.toString(), requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringTrainingConfigVersions.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 AnalyzeConversationAuthoringExportedTrainedModel getExportedModel(String projectName, + String exportedModelName) { + // Generated convenience method for getExportedModelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelWithResponse(projectName, exportedModelName, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringExportedTrainedModel.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 AnalyzeConversationAuthoringExportedTrainedModel 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(AnalyzeConversationAuthoringExportedTrainedModel.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 AnalyzeConversationAuthoringExportedTrainedModel 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(AnalyzeConversationAuthoringExportedTrainedModel.class)); + } + + /** + * 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); + } + + /** + * 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, ExportedModelOptions body) { + // Generated convenience method for beginCreateOrUpdateExportedModelWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrUpdateExportedModelWithModel(projectName, exportedModelName, + BinaryData.fromObject(body), 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 AnalyzeConversationAuthoringExportedModelJobState getExportedModelJobStatus(String projectName, + String exportedModelName, String jobId) { + // Generated convenience method for getExportedModelJobStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExportedModelJobStatusWithResponse(projectName, exportedModelName, jobId, requestOptions).getValue() + .toObject(AnalyzeConversationAuthoringExportedModelJobState.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClientBuilder.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringClientBuilder.java new file mode 100644 index 000000000000..e55892155f7a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring; + +import com.azure.ai.language.conversations.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-conversations-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().getAnalyzeConversationAuthorings()); + } + + /** + * Builds an instance of AuthoringClient class. + * + * @return an instance of AuthoringClient. + */ + @Generated + public AuthoringClient buildClient() { + return new AuthoringClient(buildInnerClient().getAnalyzeConversationAuthorings()); + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthoringClientBuilder.class); +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringServiceVersion.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/AuthoringServiceVersion.java new file mode 100644 index 000000000000..06b4b1be329c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AnalyzeConversationAuthoringsImpl.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AnalyzeConversationAuthoringsImpl.java new file mode 100644 index 000000000000..0a7cad600d0d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AnalyzeConversationAuthoringsImpl.java @@ -0,0 +1,9777 @@ +// 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.conversations.authoring.implementation; + +import com.azure.ai.language.conversations.authoring.AuthoringServiceVersion; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentResourcesJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedModelJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringImportProjectJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringLoadSnapshotJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeletionJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsJobState; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobResult; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobState; +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 AnalyzeConversationAuthorings. + */ +public final class AnalyzeConversationAuthoringsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final AnalyzeConversationAuthoringsService service; + + /** + * The service client containing this operation class. + */ + private final AuthoringClientImpl client; + + /** + * Initializes an instance of AnalyzeConversationAuthoringsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AnalyzeConversationAuthoringsImpl(AuthoringClientImpl client) { + this.service = RestProxy.create(AnalyzeConversationAuthoringsService.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 AuthoringClientAnalyzeConversationAuthorings to be used by the proxy + * service to perform REST calls. + */ + @Host("{Endpoint}/language") + @ServiceInterface(name = "AuthoringClientAnaly") + public interface AnalyzeConversationAuthoringsService { + @Get("/authoring/analyze-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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); + + @Post("/authoring/analyze-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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); + + @Get("/authoring/analyze-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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, @QueryParam("projectKind") String projectKind, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-conversations/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, @QueryParam("projectKind") String projectKind, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-conversations/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-conversations/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-conversations/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, @QueryParam("projectKind") String projectKind, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-conversations/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, @QueryParam("projectKind") String projectKind, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/authoring/analyze-conversations/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-conversations/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); + + @Get("/authoring/analyze-conversations/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-conversations/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); + + @Delete("/authoring/analyze-conversations/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-conversations/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); + + @Put("/authoring/analyze-conversations/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-conversations/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); + + @Get("/authoring/analyze-conversations/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-conversations/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("{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> 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> 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); + } + + /** + * 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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); + } + + /** + * Creates a new project or updates an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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)); + } + + /** + * Creates a new project or updates an existing one. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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(AnalyzeConversationAuthoringProjectDeletionJobState.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(AnalyzeConversationAuthoringProjectDeletionJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Generates a copy project operation authorization to the current target Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     storageInputContainerName: String (Optional)
+     *     allowOverwrite: Boolean (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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(Conversation/Orchestration/CustomConversationSummarization) (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(AnalyzeConversationAuthoringCopyProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Copies an existing project to another Azure resource. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(AnalyzeConversationAuthoringCopyProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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(AnalyzeConversationAuthoringExportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a job to export a project's data. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
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(AnalyzeConversationAuthoringExportProjectJobState.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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(AnalyzeConversationAuthoringImportProjectJobState.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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format of the exported project file to use. Allowed values: + * "Conversation", "Luis".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     projectFileVersion: String (Required)
+     *     stringIndexType: String(Utf16CodeUnit) (Required)
+     *     metadata (Required): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Optional, Required on create)
+     *         settings (Optional): {
+     *             confidenceThreshold: double (Optional, Required on create)
+     *         }
+     *         storageInputContainerName: String (Optional)
+     *         projectName: String (Optional, Required on create)
+     *         multilingual: Boolean (Optional)
+     *         description: String (Optional)
+     *         language: String (Optional, Required on create)
+     *     }
+     *     assets (Optional): {
+     *         projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (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(AnalyzeConversationAuthoringImportProjectJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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.conversations.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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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.conversations.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 (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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.conversations.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(AnalyzeConversationAuthoringTrainingJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringTrainingJobResult.class)); + } + + /** + * Triggers a training job for a project. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     modelLabel: String (Required)
+     *     trainingConfigVersion: String (Optional)
+     *     trainingMode: String(advanced/standard) (Required)
+     *     evaluationOptions (Optional): {
+     *         kind: String(percentage/manual) (Optional)
+     *         trainingSplitPercentage: Integer (Optional)
+     *         testingSplitPercentage: Integer (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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.conversations.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(AnalyzeConversationAuthoringTrainingJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringTrainingJobResult.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 AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment 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); + }); + } + + /** + * 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(AnalyzeConversationAuthoringSwapDeploymentsJobState.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(AnalyzeConversationAuthoringSwapDeploymentsJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * 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(AnalyzeConversationAuthoringDeploymentJobState.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(AnalyzeConversationAuthoringDeploymentJobState.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(AnalyzeConversationAuthoringDeploymentJobState.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(AnalyzeConversationAuthoringDeploymentJobState.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(AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.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(AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.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); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel 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.conversations.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.conversations.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.conversations.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(AnalyzeConversationAuthoringEvaluationJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringEvaluationJobResult.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.conversations.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(AnalyzeConversationAuthoringEvaluationJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringEvaluationJobResult.class)); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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)); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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)); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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)); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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(AnalyzeConversationAuthoringLoadSnapshotJobState.class), + TypeReference.createInstance(Void.class)); + } + + /** + * Restores the snapshot of this trained model to be the current working directory of the project. + * + * @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(AnalyzeConversationAuthoringLoadSnapshotJobState.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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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
+     * {
+     *     entitiesEvaluation (Required): {
+     *         confusionMatrix (Required): {
+     *              (Optional): {
+     *                 String (Required): {
+     *                      (Optional): {
+     *                         String (Required): {
+     *                             normalizedValue: double (Required)
+     *                             rawValue: double (Required)
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *         entities (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     intentsEvaluation (Required): {
+     *         confusionMatrix (Required): (recursive schema, see confusionMatrix above)
+     *         intents (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     evaluationOptions (Optional): {
+     *         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
+     * {
+     *     entitiesEvaluation (Required): {
+     *         confusionMatrix (Required): {
+     *              (Optional): {
+     *                 String (Required): {
+     *                      (Optional): {
+     *                         String (Required): {
+     *                             normalizedValue: double (Required)
+     *                             rawValue: double (Required)
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *         entities (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     intentsEvaluation (Required): {
+     *         confusionMatrix (Required): (recursive schema, see confusionMatrix above)
+     *         intents (Required): {
+     *             String (Required): {
+     *                 f1: double (Required)
+     *                 precision: double (Required)
+     *                 recall: double (Required)
+     *                 truePositiveCount: int (Required)
+     *                 trueNegativeCount: int (Required)
+     *                 falsePositiveCount: int (Required)
+     *                 falseNegativeCount: int (Required)
+     *             }
+     *         }
+     *         microF1: double (Required)
+     *         microPrecision: double (Required)
+     *         microRecall: double (Required)
+     *         macroF1: double (Required)
+     *         macroPrecision: double (Required)
+     *         macroRecall: double (Required)
+     *     }
+     *     evaluationOptions (Optional): {
+     *         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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 AnalyzeConversationAuthoringAssignedDeploymentResource 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(AnalyzeConversationAuthoringDeploymentResourcesJobState.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(AnalyzeConversationAuthoringDeploymentResourcesJobState.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(AnalyzeConversationAuthoringDeploymentResourcesJobState.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(AnalyzeConversationAuthoringDeploymentResourcesJobState.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 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 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 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 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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.conversations.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.conversations.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.conversations.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(AnalyzeConversationAuthoringTrainingJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringTrainingJobResult.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.conversations.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(AnalyzeConversationAuthoringTrainingJobState.class), + TypeReference.createInstance(AnalyzeConversationAuthoringTrainingJobResult.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 maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             projectName: String (Required)
+     *             deploymentsMetadata (Required): [
+     *                  (Required){
+     *                     deploymentName: String (Required)
+     *                     lastDeployedDateTime: OffsetDateTime (Required)
+     *                     deploymentExpirationDate: LocalDate (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 for deployments assigned to a resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAssignedResourceDeploymentsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listAssignedResourceDeployments(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to + * projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             projectName: String (Required)
+     *             deploymentsMetadata (Required): [
+     *                  (Required){
+     *                     deploymentName: String (Required)
+     *                     lastDeployedDateTime: OffsetDateTime (Required)
+     *                     deploymentExpirationDate: LocalDate (Required)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 for deployments assigned to a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAssignedResourceDeploymentsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listAssignedResourceDeploymentsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Lists the supported languages for the given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             languageName: String (Required)
+     *             languageCode: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of retrieved languages along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSupportedLanguagesWithResponseAsync(String projectKind, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSupportedLanguages(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectKind, accept, requestOptions, context)); + } + + /** + * Lists the supported languages for the given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             languageName: String (Required)
+     *             languageCode: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of retrieved languages along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedLanguagesWithResponse(String projectKind, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSupportedLanguagesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectKind, accept, requestOptions, Context.NONE); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
languageStringNoThe language to get supported prebuilt entities for. Required + * if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" + * for English (UK), "es" for Spanish etc.
multilingualStringNoWhether to get the support prebuilt entities for + * multilingual or monolingual projects. If true, the language parameter is ignored.
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             category: String (Required)
+     *             description: String (Required)
+     *             examples: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of the retrieved supported prebuilt entities along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSupportedPrebuiltEntitiesWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSupportedPrebuiltEntities(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Lists the supported prebuilt entities that can be used while creating composed entities. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
languageStringNoThe language to get supported prebuilt entities for. Required + * if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" + * for English (UK), "es" for Spanish etc.
multilingualStringNoWhether to get the support prebuilt entities for + * multilingual or monolingual projects. If true, the language parameter is ignored.
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             category: String (Required)
+     *             description: String (Required)
+     *             examples: String (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of the retrieved supported prebuilt entities along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedPrebuiltEntitiesWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSupportedPrebuiltEntitiesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             trainingConfigVersion: String (Required)
+     *             modelExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of training config versions along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTrainingConfigVersionsWithResponseAsync(String projectKind, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listTrainingConfigVersions(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectKind, accept, requestOptions, context)); + } + + /** + * Lists the support training config version for a given project type. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
topIntegerNoThe maximum number of resources to return from the + * collection.
skipIntegerNoAn offset into the collection of the first resource to be + * returned.
maxpagesizeIntegerNoThe maximum number of resources to include in a single + * response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             trainingConfigVersion: String (Required)
+     *             modelExpirationDate: LocalDate (Required)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param projectKind The project kind. Allowed values: "Conversation", "Orchestration", + * "CustomConversationSummarization". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 a list of training config versions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTrainingConfigVersionsWithResponse(String projectKind, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.listTrainingConfigVersionsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), projectKind, accept, requestOptions, Context.NONE); + } + + /** + * 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); + } + + /** + * 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 AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel 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); + }); + } + + /** + * 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(AnalyzeConversationAuthoringExportedModelJobState.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(AnalyzeConversationAuthoringExportedModelJobState.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 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(AnalyzeConversationAuthoringExportedModelJobState.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(AnalyzeConversationAuthoringExportedModelJobState.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); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastModifiedDateTime: OffsetDateTime (Required)
+     *     lastTrainedDateTime: OffsetDateTime (Optional)
+     *     lastDeployedDateTime: OffsetDateTime (Optional)
+     *     projectKind: String(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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(Conversation/Orchestration/CustomConversationSummarization) (Required)
+     *     settings (Optional): {
+     *         confidenceThreshold: double (Optional, Required on create)
+     *     }
+     *     storageInputContainerName: String (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 AnalyzeConversationAuthoringProjectMetadata 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 AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment 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
+     * {
+     *     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 AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel 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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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 AnalyzeConversationAuthoringUtteranceEvaluationResult 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
+     * {
+     *     text: String (Required)
+     *     language: String (Required)
+     *     entitiesResult (Required): {
+     *         expectedEntities (Required): [
+     *              (Required){
+     *                 category: String (Required)
+     *                 offset: int (Required)
+     *                 length: int (Required)
+     *             }
+     *         ]
+     *         predictedEntities (Required): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     intentsResult (Required): {
+     *         expectedIntent: String (Required)
+     *         predictedIntent: 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 AnalyzeConversationAuthoringUtteranceEvaluationResult 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 AnalyzeConversationAuthoringAssignedDeploymentResource 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 AnalyzeConversationAuthoringAssignedDeploymentResource 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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)
+     *         trainingMode: String(advanced/standard) (Optional)
+     *         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 AnalyzeConversationAuthoringTrainingJobState 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
+     * {
+     *     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 AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel 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); + } + + 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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AuthoringClientImpl.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/AuthoringClientImpl.java new file mode 100644 index 000000000000..294f844c62ee --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring.implementation; + +import com.azure.ai.language.conversations.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 AnalyzeConversationAuthoringsImpl object to access its operations. + */ + private final AnalyzeConversationAuthoringsImpl analyzeConversationAuthorings; + + /** + * Gets the AnalyzeConversationAuthoringsImpl object to access its operations. + * + * @return the AnalyzeConversationAuthoringsImpl object. + */ + public AnalyzeConversationAuthoringsImpl getAnalyzeConversationAuthorings() { + return this.analyzeConversationAuthorings; + } + + /** + * 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.analyzeConversationAuthorings = new AnalyzeConversationAuthoringsImpl(this); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/JsonMergePatchHelper.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..6220320ec22a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/JsonMergePatchHelper.java @@ -0,0 +1,55 @@ +// 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.conversations.authoring.implementation; + +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateProjectOptions; +import com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectSettings; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static AnalyzeConversationAuthoringProjectSettingsAccessor analyzeConversationAuthoringProjectSettingsAccessor; + + public interface AnalyzeConversationAuthoringProjectSettingsAccessor { + AnalyzeConversationAuthoringProjectSettings prepareModelForJsonMergePatch( + AnalyzeConversationAuthoringProjectSettings analyzeConversationAuthoringProjectSettings, + boolean jsonMergePatchEnabled); + + boolean + isJsonMergePatch(AnalyzeConversationAuthoringProjectSettings analyzeConversationAuthoringProjectSettings); + } + + public static void setAnalyzeConversationAuthoringProjectSettingsAccessor( + AnalyzeConversationAuthoringProjectSettingsAccessor accessor) { + analyzeConversationAuthoringProjectSettingsAccessor = accessor; + } + + public static AnalyzeConversationAuthoringProjectSettingsAccessor + getAnalyzeConversationAuthoringProjectSettingsAccessor() { + return analyzeConversationAuthoringProjectSettingsAccessor; + } + + private static AnalyzeConversationAuthoringCreateProjectOptionsAccessor analyzeConversationAuthoringCreateProjectOptionsAccessor; + + public interface AnalyzeConversationAuthoringCreateProjectOptionsAccessor { + AnalyzeConversationAuthoringCreateProjectOptions prepareModelForJsonMergePatch( + AnalyzeConversationAuthoringCreateProjectOptions analyzeConversationAuthoringCreateProjectOptions, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch( + AnalyzeConversationAuthoringCreateProjectOptions analyzeConversationAuthoringCreateProjectOptions); + } + + public static void setAnalyzeConversationAuthoringCreateProjectOptionsAccessor( + AnalyzeConversationAuthoringCreateProjectOptionsAccessor accessor) { + analyzeConversationAuthoringCreateProjectOptionsAccessor = accessor; + } + + public static AnalyzeConversationAuthoringCreateProjectOptionsAccessor + getAnalyzeConversationAuthoringCreateProjectOptionsAccessor() { + return analyzeConversationAuthoringCreateProjectOptionsAccessor; + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/OperationLocationPollingStrategy.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/OperationLocationPollingStrategy.java new file mode 100644 index 000000000000..210d2c78ba74 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/PollingUtils.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/PollingUtils.java new file mode 100644 index 000000000000..4a9f6c2d5e03 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/SyncOperationLocationPollingStrategy.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/SyncOperationLocationPollingStrategy.java new file mode 100644 index 000000000000..34ba06fdc04d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/CopyProjectAuthorizationRequest.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/CopyProjectAuthorizationRequest.java new file mode 100644 index 000000000000..8fe706539e78 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring.implementation.models; + +import com.azure.ai.language.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/package-info.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/models/package-info.java new file mode 100644 index 000000000000..f8ae64e3fdcf --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring.implementation.models; diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/package-info.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/implementation/package-info.java new file mode 100644 index 000000000000..92eb8595b73f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring.implementation; diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignDeploymentResourcesOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignDeploymentResourcesOptions.java new file mode 100644 index 000000000000..470a3d8ae2db --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignDeploymentResourcesOptions.java @@ -0,0 +1,90 @@ +// 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.conversations.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 AnalyzeConversationAuthoringAssignDeploymentResourcesOptions + implements JsonSerializable { + /* + * Represents the metadata for the resources to be assigned. + */ + @Generated + private final List resourcesMetadata; + + /** + * Creates an instance of AnalyzeConversationAuthoringAssignDeploymentResourcesOptions class. + * + * @param resourcesMetadata the resourcesMetadata value to set. + */ + @Generated + public AnalyzeConversationAuthoringAssignDeploymentResourcesOptions( + 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 AnalyzeConversationAuthoringAssignDeploymentResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringAssignDeploymentResourcesOptions 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 + * AnalyzeConversationAuthoringAssignDeploymentResourcesOptions. + */ + @Generated + public static AnalyzeConversationAuthoringAssignDeploymentResourcesOptions 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 -> AnalyzeConversationAuthoringResourceMetadata.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringAssignDeploymentResourcesOptions(resourcesMetadata); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedDeploymentResource.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedDeploymentResource.java new file mode 100644 index 000000000000..c77b94f76c58 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedDeploymentResource.java @@ -0,0 +1,108 @@ +// 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.conversations.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 AnalyzeConversationAuthoringAssignedDeploymentResource + implements JsonSerializable { + /* + * The resource ID. + */ + @Generated + private String azureResourceId; + + /* + * The resource region. + */ + @Generated + private final String region; + + /** + * Creates an instance of AnalyzeConversationAuthoringAssignedDeploymentResource class. + * + * @param region the region value to set. + */ + @Generated + private AnalyzeConversationAuthoringAssignedDeploymentResource(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 AnalyzeConversationAuthoringAssignedDeploymentResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringAssignedDeploymentResource 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 AnalyzeConversationAuthoringAssignedDeploymentResource. + */ + @Generated + public static AnalyzeConversationAuthoringAssignedDeploymentResource 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(); + } + } + AnalyzeConversationAuthoringAssignedDeploymentResource deserializedAnalyzeConversationAuthoringAssignedDeploymentResource + = new AnalyzeConversationAuthoringAssignedDeploymentResource(region); + deserializedAnalyzeConversationAuthoringAssignedDeploymentResource.azureResourceId = azureResourceId; + + return deserializedAnalyzeConversationAuthoringAssignedDeploymentResource; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata.java new file mode 100644 index 000000000000..2132e14ca4f5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata.java @@ -0,0 +1,142 @@ +// 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.conversations.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 AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata + 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 AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata class. + * + * @param deploymentName the deploymentName value to set. + * @param lastDeployedDateTime the lastDeployedDateTime value to set. + * @param deploymentExpirationDate the deploymentExpirationDate value to set. + */ + @Generated + private AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata(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 AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata 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 + * AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata. + */ + @Generated + public static AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata 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 AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata(deploymentName, + lastDeployedDateTime, deploymentExpirationDate); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata.java new file mode 100644 index 000000000000..f648f40ac34b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata.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.conversations.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 AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata + implements JsonSerializable { + /* + * Represents the project name. + */ + @Generated + private final String projectName; + + /* + * Represents the resource region. + */ + @Generated + private final List deploymentsMetadata; + + /** + * Creates an instance of AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata class. + * + * @param projectName the projectName value to set. + * @param deploymentsMetadata the deploymentsMetadata value to set. + */ + @Generated + private AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata(String projectName, + List deploymentsMetadata) { + this.projectName = projectName; + 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.writeStringField("projectName", this.projectName); + jsonWriter.writeArrayField("deploymentsMetadata", this.deploymentsMetadata, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata 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 + * AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata. + */ + @Generated + public static AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata 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 -> AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.java new file mode 100644 index 000000000000..6ad3045fdbaa --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.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.conversations.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 deployments assigned to a resource. + */ +@Immutable +public final class AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata + implements JsonSerializable { + /* + * The list of retrieved assigned project deployments. + */ + @Generated + private final List value; + + /* + * The next page link. + */ + @Generated + private String nextLink; + + /** + * Creates an instance of AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata class. + * + * @param value the value value to set. + */ + @Generated + private AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata( + List value) { + this.value = value; + } + + /** + * Get the value property: The list of retrieved assigned project deployments. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: The next page link. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata 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 + * AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata. + */ + @Generated + public static AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray( + reader1 -> AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata.fromJson(reader1)); + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata deserializedAnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata + = new AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata(value); + deserializedAnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata.nextLink = nextLink; + + return deserializedAnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrix.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrix.java new file mode 100644 index 000000000000..790ce74761db --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrix.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.conversations.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 AnalyzeConversationAuthoringConfusionMatrix model. + */ +@Immutable +public final class AnalyzeConversationAuthoringConfusionMatrix + implements JsonSerializable { + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of AnalyzeConversationAuthoringConfusionMatrix class. + */ + @Generated + private AnalyzeConversationAuthoringConfusionMatrix() { + } + + /** + * 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 AnalyzeConversationAuthoringConfusionMatrix from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConfusionMatrix 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 AnalyzeConversationAuthoringConfusionMatrix. + */ + @Generated + public static AnalyzeConversationAuthoringConfusionMatrix fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringConfusionMatrix deserializedAnalyzeConversationAuthoringConfusionMatrix + = new AnalyzeConversationAuthoringConfusionMatrix(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, AnalyzeConversationAuthoringConfusionMatrixRow.fromJson(reader)); + } + deserializedAnalyzeConversationAuthoringConfusionMatrix.additionalProperties = additionalProperties; + + return deserializedAnalyzeConversationAuthoringConfusionMatrix; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixCell.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixCell.java new file mode 100644 index 000000000000..c3db6604f609 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixCell.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.conversations.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 AnalyzeConversationAuthoringConfusionMatrixCell + implements JsonSerializable { + /* + * Represents normalized value in percentages. + */ + @Generated + private final double normalizedValue; + + /* + * Represents raw value. + */ + @Generated + private final double rawValue; + + /** + * Creates an instance of AnalyzeConversationAuthoringConfusionMatrixCell class. + * + * @param normalizedValue the normalizedValue value to set. + * @param rawValue the rawValue value to set. + */ + @Generated + private AnalyzeConversationAuthoringConfusionMatrixCell(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 AnalyzeConversationAuthoringConfusionMatrixCell from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConfusionMatrixCell 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 AnalyzeConversationAuthoringConfusionMatrixCell. + */ + @Generated + public static AnalyzeConversationAuthoringConfusionMatrixCell 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 AnalyzeConversationAuthoringConfusionMatrixCell(normalizedValue, rawValue); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixRow.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixRow.java new file mode 100644 index 000000000000..3085d292dbf6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConfusionMatrixRow.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.conversations.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 AnalyzeConversationAuthoringConfusionMatrixRow model. + */ +@Immutable +public final class AnalyzeConversationAuthoringConfusionMatrixRow + implements JsonSerializable { + /* + * Additional properties + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of AnalyzeConversationAuthoringConfusionMatrixRow class. + */ + @Generated + private AnalyzeConversationAuthoringConfusionMatrixRow() { + } + + /** + * 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 AnalyzeConversationAuthoringConfusionMatrixRow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConfusionMatrixRow 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 AnalyzeConversationAuthoringConfusionMatrixRow. + */ + @Generated + public static AnalyzeConversationAuthoringConfusionMatrixRow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringConfusionMatrixRow deserializedAnalyzeConversationAuthoringConfusionMatrixRow + = new AnalyzeConversationAuthoringConfusionMatrixRow(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, AnalyzeConversationAuthoringConfusionMatrixCell.fromJson(reader)); + } + deserializedAnalyzeConversationAuthoringConfusionMatrixRow.additionalProperties = additionalProperties; + + return deserializedAnalyzeConversationAuthoringConfusionMatrixRow; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedEntity.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedEntity.java new file mode 100644 index 000000000000..c19e7df453eb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedEntity.java @@ -0,0 +1,264 @@ +// 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.conversations.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 with its components. + */ +@Fluent +public final class AnalyzeConversationAuthoringConversationExportedEntity + implements JsonSerializable { + /* + * The category of the entity. + */ + @Generated + private final String category; + + /* + * 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 AnalyzeConversationAuthoringExportedEntityList list; + + /* + * The prebuilt entities components. + */ + @Generated + private List prebuilts; + + /* + * The regex component of the entity. + */ + @Generated + private AnalyzeConversationAuthoringExportedEntityRegex regex; + + /* + * The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + */ + @Generated + private List requiredComponents; + + /** + * Creates an instance of AnalyzeConversationAuthoringConversationExportedEntity class. + * + * @param category the category value to set. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity(String category) { + this.category = category; + } + + /** + * Get the category property: The category of the entity. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * 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 AnalyzeConversationAuthoringConversationExportedEntity object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity + setCompositionSetting(CompositionSetting compositionSetting) { + this.compositionSetting = compositionSetting; + return this; + } + + /** + * Get the list property: The list component of the entity. + * + * @return the list value. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityList getList() { + return this.list; + } + + /** + * Set the list property: The list component of the entity. + * + * @param list the list value to set. + * @return the AnalyzeConversationAuthoringConversationExportedEntity object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity + setList(AnalyzeConversationAuthoringExportedEntityList 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 AnalyzeConversationAuthoringConversationExportedEntity object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity + setPrebuilts(List prebuilts) { + this.prebuilts = prebuilts; + return this; + } + + /** + * Get the regex property: The regex component of the entity. + * + * @return the regex value. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegex getRegex() { + return this.regex; + } + + /** + * Set the regex property: The regex component of the entity. + * + * @param regex the regex value to set. + * @return the AnalyzeConversationAuthoringConversationExportedEntity object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity + setRegex(AnalyzeConversationAuthoringExportedEntityRegex regex) { + this.regex = regex; + return this; + } + + /** + * Get the requiredComponents property: The required components. Allowed values are 'learned', 'list', 'prebuilts' + * and 'regex'. + * + * @return the requiredComponents value. + */ + @Generated + public List getRequiredComponents() { + return this.requiredComponents; + } + + /** + * Set the requiredComponents property: The required components. Allowed values are 'learned', 'list', 'prebuilts' + * and 'regex'. + * + * @param requiredComponents the requiredComponents value to set. + * @return the AnalyzeConversationAuthoringConversationExportedEntity object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedEntity + setRequiredComponents(List requiredComponents) { + this.requiredComponents = requiredComponents; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + 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.writeJsonField("regex", this.regex); + jsonWriter.writeArrayField("requiredComponents", this.requiredComponents, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringConversationExportedEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConversationExportedEntity 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 AnalyzeConversationAuthoringConversationExportedEntity. + */ + @Generated + public static AnalyzeConversationAuthoringConversationExportedEntity fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String category = null; + CompositionSetting compositionSetting = null; + AnalyzeConversationAuthoringExportedEntityList list = null; + List prebuilts = null; + AnalyzeConversationAuthoringExportedEntityRegex regex = null; + List requiredComponents = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = reader.getString(); + } else if ("compositionSetting".equals(fieldName)) { + compositionSetting = CompositionSetting.fromString(reader.getString()); + } else if ("list".equals(fieldName)) { + list = AnalyzeConversationAuthoringExportedEntityList.fromJson(reader); + } else if ("prebuilts".equals(fieldName)) { + prebuilts = reader + .readArray(reader1 -> AnalyzeConversationAuthoringExportedPrebuiltEntity.fromJson(reader1)); + } else if ("regex".equals(fieldName)) { + regex = AnalyzeConversationAuthoringExportedEntityRegex.fromJson(reader); + } else if ("requiredComponents".equals(fieldName)) { + requiredComponents = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringConversationExportedEntity deserializedAnalyzeConversationAuthoringConversationExportedEntity + = new AnalyzeConversationAuthoringConversationExportedEntity(category); + deserializedAnalyzeConversationAuthoringConversationExportedEntity.compositionSetting = compositionSetting; + deserializedAnalyzeConversationAuthoringConversationExportedEntity.list = list; + deserializedAnalyzeConversationAuthoringConversationExportedEntity.prebuilts = prebuilts; + deserializedAnalyzeConversationAuthoringConversationExportedEntity.regex = regex; + deserializedAnalyzeConversationAuthoringConversationExportedEntity.requiredComponents = requiredComponents; + + return deserializedAnalyzeConversationAuthoringConversationExportedEntity; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedIntent.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedIntent.java new file mode 100644 index 000000000000..cdfac1ea0694 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedIntent.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.conversations.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 intent of a conversational project. + */ +@Immutable +public final class AnalyzeConversationAuthoringConversationExportedIntent + implements JsonSerializable { + /* + * The intent category. + */ + @Generated + private final String category; + + /** + * Creates an instance of AnalyzeConversationAuthoringConversationExportedIntent class. + * + * @param category the category value to set. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedIntent(String category) { + this.category = category; + } + + /** + * Get the category property: The intent 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 AnalyzeConversationAuthoringConversationExportedIntent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConversationExportedIntent 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 AnalyzeConversationAuthoringConversationExportedIntent. + */ + @Generated + public static AnalyzeConversationAuthoringConversationExportedIntent 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 AnalyzeConversationAuthoringConversationExportedIntent(category); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedProjectAssets.java new file mode 100644 index 000000000000..336e20321663 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedProjectAssets.java @@ -0,0 +1,188 @@ +// 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.conversations.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 of a conversational project. + */ +@Fluent +public final class AnalyzeConversationAuthoringConversationExportedProjectAssets + extends AnalyzeConversationAuthoringExportedProjectAssets { + /* + * The type of project containing the assets. + */ + @Generated + private ProjectKind projectKind = ProjectKind.CONVERSATION; + + /* + * The intents defined in the project. + */ + @Generated + private List intents; + + /* + * The entities defined in the project. + */ + @Generated + private List entities; + + /* + * The utterances defined in the project. + */ + @Generated + private List utterances; + + /** + * Creates an instance of AnalyzeConversationAuthoringConversationExportedProjectAssets class. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedProjectAssets() { + } + + /** + * Get the projectKind property: The type of project containing the assets. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the intents property: The intents defined in the project. + * + * @return the intents value. + */ + @Generated + public List getIntents() { + return this.intents; + } + + /** + * Set the intents property: The intents defined in the project. + * + * @param intents the intents value to set. + * @return the AnalyzeConversationAuthoringConversationExportedProjectAssets object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedProjectAssets + setIntents(List intents) { + this.intents = intents; + return this; + } + + /** + * Get the entities property: The entities defined in the project. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: The entities defined in the project. + * + * @param entities the entities value to set. + * @return the AnalyzeConversationAuthoringConversationExportedProjectAssets object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedProjectAssets + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the utterances property: The utterances defined in the project. + * + * @return the utterances value. + */ + @Generated + public List getUtterances() { + return this.utterances; + } + + /** + * Set the utterances property: The utterances defined in the project. + * + * @param utterances the utterances value to set. + * @return the AnalyzeConversationAuthoringConversationExportedProjectAssets object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedProjectAssets + setUtterances(List utterances) { + this.utterances = utterances; + 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("intents", this.intents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("utterances", this.utterances, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringConversationExportedProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConversationExportedProjectAssets 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 + * AnalyzeConversationAuthoringConversationExportedProjectAssets. + */ + @Generated + public static AnalyzeConversationAuthoringConversationExportedProjectAssets fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringConversationExportedProjectAssets deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets + = new AnalyzeConversationAuthoringConversationExportedProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("intents".equals(fieldName)) { + List intents = reader + .readArray(reader1 -> AnalyzeConversationAuthoringConversationExportedIntent.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets.intents = intents; + } else if ("entities".equals(fieldName)) { + List entities = reader + .readArray(reader1 -> AnalyzeConversationAuthoringConversationExportedEntity.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets.entities = entities; + } else if ("utterances".equals(fieldName)) { + List utterances = reader.readArray( + reader1 -> AnalyzeConversationAuthoringConversationExportedUtterance.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets.utterances = utterances; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringConversationExportedProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedUtterance.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedUtterance.java new file mode 100644 index 000000000000..5178297198d8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringConversationExportedUtterance.java @@ -0,0 +1,216 @@ +// 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.conversations.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 utterance for a conversational project. + */ +@Fluent +public final class AnalyzeConversationAuthoringConversationExportedUtterance + implements JsonSerializable { + /* + * Represents the entity labels of the utterance. + */ + @Generated + private List entities; + + /* + * The utterance text. + */ + @Generated + private final String text; + + /* + * Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for + * English, "en-gb" for English (UK), "es" for Spanish etc. + */ + @Generated + private String language; + + /* + * The intent of the utterance. + */ + @Generated + private final String intent; + + /* + * The dataset for this utterance. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of AnalyzeConversationAuthoringConversationExportedUtterance class. + * + * @param text the text value to set. + * @param intent the intent value to set. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedUtterance(String text, String intent) { + this.text = text; + this.intent = intent; + } + + /** + * Get the entities property: Represents the entity labels of the utterance. + * + * @return the entities value. + */ + @Generated + public List getEntities() { + return this.entities; + } + + /** + * Set the entities property: Represents the entity labels of the utterance. + * + * @param entities the entities value to set. + * @return the AnalyzeConversationAuthoringConversationExportedUtterance object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedUtterance + setEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the text property: The utterance text. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Get the language property: Represents the utterance's language. This is BCP-47 representation of a language. For + * example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: Represents the utterance's language. This is BCP-47 representation of a language. For + * example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + * + * @param language the language value to set. + * @return the AnalyzeConversationAuthoringConversationExportedUtterance object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedUtterance setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the intent property: The intent of the utterance. + * + * @return the intent value. + */ + @Generated + public String getIntent() { + return this.intent; + } + + /** + * Get the dataset property: The dataset for this utterance. 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 utterance. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the AnalyzeConversationAuthoringConversationExportedUtterance object itself. + */ + @Generated + public AnalyzeConversationAuthoringConversationExportedUtterance setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("intent", this.intent); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringConversationExportedUtterance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringConversationExportedUtterance 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 + * AnalyzeConversationAuthoringConversationExportedUtterance. + */ + @Generated + public static AnalyzeConversationAuthoringConversationExportedUtterance fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + String intent = null; + List entities = null; + String language = null; + String dataset = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("intent".equals(fieldName)) { + intent = reader.getString(); + } else if ("entities".equals(fieldName)) { + entities = reader.readArray( + reader1 -> AnalyzeConversationAuthoringExportedUtteranceEntityLabel.fromJson(reader1)); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("dataset".equals(fieldName)) { + dataset = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringConversationExportedUtterance deserializedAnalyzeConversationAuthoringConversationExportedUtterance + = new AnalyzeConversationAuthoringConversationExportedUtterance(text, intent); + deserializedAnalyzeConversationAuthoringConversationExportedUtterance.entities = entities; + deserializedAnalyzeConversationAuthoringConversationExportedUtterance.language = language; + deserializedAnalyzeConversationAuthoringConversationExportedUtterance.dataset = dataset; + + return deserializedAnalyzeConversationAuthoringConversationExportedUtterance; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectJobState.java new file mode 100644 index 000000000000..4004deaf1d9d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectJobState.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.conversations.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 AnalyzeConversationAuthoringCopyProjectJobState + 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 AnalyzeConversationAuthoringCopyProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringCopyProjectJobState(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 AnalyzeConversationAuthoringCopyProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringCopyProjectJobState 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 AnalyzeConversationAuthoringCopyProjectJobState. + */ + @Generated + public static AnalyzeConversationAuthoringCopyProjectJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringCopyProjectJobState deserializedAnalyzeConversationAuthoringCopyProjectJobState + = new AnalyzeConversationAuthoringCopyProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringCopyProjectJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringCopyProjectJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringCopyProjectJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringCopyProjectJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringCopyProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectOptions.java new file mode 100644 index 000000000000..da6dc1848cc9 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCopyProjectOptions.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.conversations.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 AnalyzeConversationAuthoringCopyProjectOptions + 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 AnalyzeConversationAuthoringCopyProjectOptions 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 AnalyzeConversationAuthoringCopyProjectOptions(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 AnalyzeConversationAuthoringCopyProjectOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringCopyProjectOptions 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 AnalyzeConversationAuthoringCopyProjectOptions. + */ + @Generated + public static AnalyzeConversationAuthoringCopyProjectOptions 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 AnalyzeConversationAuthoringCopyProjectOptions(projectKind, targetProjectName, accessToken, + expiresAt, targetResourceId, targetResourceRegion); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateDeploymentOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateDeploymentOptions.java new file mode 100644 index 000000000000..5007ba8049ff --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateDeploymentOptions.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.conversations.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 AnalyzeConversationAuthoringCreateDeploymentOptions + 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 AnalyzeConversationAuthoringCreateDeploymentOptions class. + * + * @param trainedModelLabel the trainedModelLabel value to set. + */ + @Generated + public AnalyzeConversationAuthoringCreateDeploymentOptions(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 AnalyzeConversationAuthoringCreateDeploymentOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateDeploymentOptions + 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 AnalyzeConversationAuthoringCreateDeploymentOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringCreateDeploymentOptions 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 AnalyzeConversationAuthoringCreateDeploymentOptions. + */ + @Generated + public static AnalyzeConversationAuthoringCreateDeploymentOptions 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(); + } + } + AnalyzeConversationAuthoringCreateDeploymentOptions deserializedAnalyzeConversationAuthoringCreateDeploymentOptions + = new AnalyzeConversationAuthoringCreateDeploymentOptions(trainedModelLabel); + deserializedAnalyzeConversationAuthoringCreateDeploymentOptions.assignedResourceIds = assignedResourceIds; + + return deserializedAnalyzeConversationAuthoringCreateDeploymentOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateProjectOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateProjectOptions.java new file mode 100644 index 000000000000..3691fbaf8b05 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringCreateProjectOptions.java @@ -0,0 +1,396 @@ +// 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.conversations.authoring.models; + +import com.azure.ai.language.conversations.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 AnalyzeConversationAuthoringCreateProjectOptions + implements JsonSerializable { + /* + * Represents the project kind. + */ + @Generated + private ProjectKind projectKind; + + /* + * The project settings. + */ + @Generated + private AnalyzeConversationAuthoringProjectSettings settings; + + /* + * The storage container name in case of conversation summarization. + */ + @Generated + private String storageInputContainerName; + + /* + * 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.setAnalyzeConversationAuthoringCreateProjectOptionsAccessor( + new JsonMergePatchHelper.AnalyzeConversationAuthoringCreateProjectOptionsAccessor() { + @Override + public AnalyzeConversationAuthoringCreateProjectOptions prepareModelForJsonMergePatch( + AnalyzeConversationAuthoringCreateProjectOptions model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(AnalyzeConversationAuthoringCreateProjectOptions model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of AnalyzeConversationAuthoringCreateProjectOptions class. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions() { + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Set the projectKind property: Represents the project kind. + *

Required when create the resource.

+ * + * @param projectKind the projectKind value to set. + * @return the AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions setProjectKind(ProjectKind projectKind) { + this.projectKind = projectKind; + this.updatedProperties.add("projectKind"); + return this; + } + + /** + * Get the settings property: The project settings. + * + * @return the settings value. + */ + @Generated + public AnalyzeConversationAuthoringProjectSettings getSettings() { + return this.settings; + } + + /** + * Set the settings property: The project settings. + * + * @param settings the settings value to set. + * @return the AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions + setSettings(AnalyzeConversationAuthoringProjectSettings settings) { + this.settings = settings; + this.updatedProperties.add("settings"); + return this; + } + + /** + * Get the storageInputContainerName property: The storage container name in case of conversation summarization. + * + * @return the storageInputContainerName value. + */ + @Generated + public String getStorageInputContainerName() { + return this.storageInputContainerName; + } + + /** + * Set the storageInputContainerName property: The storage container name in case of conversation summarization. + * + * @param storageInputContainerName the storageInputContainerName value to set. + * @return the AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions + setStorageInputContainerName(String storageInputContainerName) { + this.storageInputContainerName = storageInputContainerName; + this.updatedProperties.add("storageInputContainerName"); + 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 AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions 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 AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions 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 AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions 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 AnalyzeConversationAuthoringCreateProjectOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringCreateProjectOptions 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.writeJsonField("settings", this.settings); + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + 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("settings")) { + if (this.settings == null) { + jsonWriter.writeNullField("settings"); + } else { + JsonMergePatchHelper.getAnalyzeConversationAuthoringProjectSettingsAccessor() + .prepareModelForJsonMergePatch(this.settings, true); + jsonWriter.writeJsonField("settings", this.settings); + JsonMergePatchHelper.getAnalyzeConversationAuthoringProjectSettingsAccessor() + .prepareModelForJsonMergePatch(this.settings, false); + } + } + if (updatedProperties.contains("storageInputContainerName")) { + if (this.storageInputContainerName == null) { + jsonWriter.writeNullField("storageInputContainerName"); + } else { + jsonWriter.writeStringField("storageInputContainerName", this.storageInputContainerName); + } + } + 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 AnalyzeConversationAuthoringCreateProjectOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringCreateProjectOptions 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 AnalyzeConversationAuthoringCreateProjectOptions. + */ + @Generated + public static AnalyzeConversationAuthoringCreateProjectOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringCreateProjectOptions deserializedAnalyzeConversationAuthoringCreateProjectOptions + = new AnalyzeConversationAuthoringCreateProjectOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("settings".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.settings + = AnalyzeConversationAuthoringProjectSettings.fromJson(reader); + } else if ("storageInputContainerName".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.storageInputContainerName + = reader.getString(); + } else if ("projectName".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.projectName = reader.getString(); + } else if ("multilingual".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.multilingual + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.description = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringCreateProjectOptions.language = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringCreateProjectOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeleteDeploymentOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeleteDeploymentOptions.java new file mode 100644 index 000000000000..c7d5eb8f3f6e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeleteDeploymentOptions.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.conversations.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 AnalyzeConversationAuthoringDeleteDeploymentOptions + 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 AnalyzeConversationAuthoringDeleteDeploymentOptions class. + */ + @Generated + public AnalyzeConversationAuthoringDeleteDeploymentOptions() { + } + + /** + * 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 AnalyzeConversationAuthoringDeleteDeploymentOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringDeleteDeploymentOptions + 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 AnalyzeConversationAuthoringDeleteDeploymentOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringDeleteDeploymentOptions 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 AnalyzeConversationAuthoringDeleteDeploymentOptions. + */ + @Generated + public static AnalyzeConversationAuthoringDeleteDeploymentOptions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringDeleteDeploymentOptions deserializedAnalyzeConversationAuthoringDeleteDeploymentOptions + = new AnalyzeConversationAuthoringDeleteDeploymentOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedResourceIds".equals(fieldName)) { + List assignedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAnalyzeConversationAuthoringDeleteDeploymentOptions.assignedResourceIds + = assignedResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringDeleteDeploymentOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.java new file mode 100644 index 000000000000..ee87ab93a635 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.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.conversations.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 AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState + 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 AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState(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 AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState 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 + * AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState. + */ + @Generated + public static AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState + = new AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState(createdDateTime, + lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.expirationDateTime + = expirationDateTime; + deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentJobState.java new file mode 100644 index 000000000000..15b4159a319d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentJobState.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.conversations.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 AnalyzeConversationAuthoringDeploymentJobState + 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 AnalyzeConversationAuthoringDeploymentJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringDeploymentJobState(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 AnalyzeConversationAuthoringDeploymentJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringDeploymentJobState 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 AnalyzeConversationAuthoringDeploymentJobState. + */ + @Generated + public static AnalyzeConversationAuthoringDeploymentJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringDeploymentJobState deserializedAnalyzeConversationAuthoringDeploymentJobState + = new AnalyzeConversationAuthoringDeploymentJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringDeploymentJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringDeploymentJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringDeploymentJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringDeploymentJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringDeploymentJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResource.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResource.java new file mode 100644 index 000000000000..0a2cb7caed37 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResource.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.conversations.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 AnalyzeConversationAuthoringDeploymentResource + 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 AnalyzeConversationAuthoringDeploymentResource class. + * + * @param resourceId the resourceId value to set. + * @param region the region value to set. + */ + @Generated + private AnalyzeConversationAuthoringDeploymentResource(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 AnalyzeConversationAuthoringDeploymentResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringDeploymentResource 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 AnalyzeConversationAuthoringDeploymentResource. + */ + @Generated + public static AnalyzeConversationAuthoringDeploymentResource 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 AnalyzeConversationAuthoringDeploymentResource(resourceId, region); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResourcesJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResourcesJobState.java new file mode 100644 index 000000000000..73288d2f44a5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringDeploymentResourcesJobState.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.conversations.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 resources job. + */ +@Immutable +public final class AnalyzeConversationAuthoringDeploymentResourcesJobState + 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 AnalyzeConversationAuthoringDeploymentResourcesJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringDeploymentResourcesJobState(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 AnalyzeConversationAuthoringDeploymentResourcesJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringDeploymentResourcesJobState 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 AnalyzeConversationAuthoringDeploymentResourcesJobState. + */ + @Generated + public static AnalyzeConversationAuthoringDeploymentResourcesJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringDeploymentResourcesJobState deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState + = new AnalyzeConversationAuthoringDeploymentResourcesJobState(createdDateTime, lastUpdatedDateTime, + status); + deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringDeploymentResourcesJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntitiesEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntitiesEvaluationSummary.java new file mode 100644 index 000000000000..868edc60f51a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntitiesEvaluationSummary.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.conversations.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 result summary for the project's entities. + */ +@Immutable +public final class AnalyzeConversationAuthoringEntitiesEvaluationSummary + 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 AnalyzeConversationAuthoringConfusionMatrix confusionMatrix; + + /* + * Represents the entities evaluation summary. + */ + @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 AnalyzeConversationAuthoringEntitiesEvaluationSummary 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 AnalyzeConversationAuthoringEntitiesEvaluationSummary( + AnalyzeConversationAuthoringConfusionMatrix 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 AnalyzeConversationAuthoringConfusionMatrix getConfusionMatrix() { + return this.confusionMatrix; + } + + /** + * Get the entities property: Represents the entities evaluation summary. + * + * @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 AnalyzeConversationAuthoringEntitiesEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEntitiesEvaluationSummary 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 AnalyzeConversationAuthoringEntitiesEvaluationSummary. + */ + @Generated + public static AnalyzeConversationAuthoringEntitiesEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringConfusionMatrix 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 = AnalyzeConversationAuthoringConfusionMatrix.fromJson(reader); + } else if ("entities".equals(fieldName)) { + entities = reader + .readMap(reader1 -> AnalyzeConversationAuthoringEntityEvaluationSummary.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 AnalyzeConversationAuthoringEntitiesEvaluationSummary(confusionMatrix, entities, microF1, + microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntityEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntityEvaluationSummary.java new file mode 100644 index 000000000000..b61fce86abdc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEntityEvaluationSummary.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.conversations.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 for an entity. + */ +@Immutable +public final class AnalyzeConversationAuthoringEntityEvaluationSummary + 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 AnalyzeConversationAuthoringEntityEvaluationSummary 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 AnalyzeConversationAuthoringEntityEvaluationSummary(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 AnalyzeConversationAuthoringEntityEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEntityEvaluationSummary 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 AnalyzeConversationAuthoringEntityEvaluationSummary. + */ + @Generated + public static AnalyzeConversationAuthoringEntityEvaluationSummary 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 AnalyzeConversationAuthoringEntityEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobResult.java new file mode 100644 index 000000000000..f758fe34430f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobResult.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.conversations.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 AnalyzeConversationAuthoringEvaluationJobResult model. + */ +@Immutable +public final class AnalyzeConversationAuthoringEvaluationJobResult + implements JsonSerializable { + /* + * Represents the options used running the evaluation. + */ + @Generated + private final AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationJobResult 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 AnalyzeConversationAuthoringEvaluationJobResult( + AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEvaluationJobResult 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 AnalyzeConversationAuthoringEvaluationJobResult. + */ + @Generated + public static AnalyzeConversationAuthoringEvaluationJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringEvaluationOptions 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 = AnalyzeConversationAuthoringEvaluationOptions.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 AnalyzeConversationAuthoringEvaluationJobResult(evaluationOptions, modelLabel, + trainingConfigVersion, percentComplete); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobState.java new file mode 100644 index 000000000000..6160c261597f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationJobState.java @@ -0,0 +1,252 @@ +// 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.conversations.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 AnalyzeConversationAuthoringEvaluationJobState + 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 AnalyzeConversationAuthoringEvaluationJobResult result; + + /** + * Creates an instance of AnalyzeConversationAuthoringEvaluationJobState 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 AnalyzeConversationAuthoringEvaluationJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status, AnalyzeConversationAuthoringEvaluationJobResult 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 AnalyzeConversationAuthoringEvaluationJobResult 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 AnalyzeConversationAuthoringEvaluationJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEvaluationJobState 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 AnalyzeConversationAuthoringEvaluationJobState. + */ + @Generated + public static AnalyzeConversationAuthoringEvaluationJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + AnalyzeConversationAuthoringEvaluationJobResult 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 = AnalyzeConversationAuthoringEvaluationJobResult.fromJson(reader); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringEvaluationJobState deserializedAnalyzeConversationAuthoringEvaluationJobState + = new AnalyzeConversationAuthoringEvaluationJobState(createdDateTime, lastUpdatedDateTime, status, + result); + deserializedAnalyzeConversationAuthoringEvaluationJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringEvaluationJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringEvaluationJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringEvaluationJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringEvaluationJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationOptions.java new file mode 100644 index 000000000000..80d0842afea0 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationOptions.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.conversations.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 AnalyzeConversationAuthoringEvaluationOptions + 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 AnalyzeConversationAuthoringEvaluationOptions class. + */ + @Generated + public AnalyzeConversationAuthoringEvaluationOptions() { + } + + /** + * 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 AnalyzeConversationAuthoringEvaluationOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringEvaluationOptions. + */ + @Generated + public static AnalyzeConversationAuthoringEvaluationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringEvaluationOptions deserializedAnalyzeConversationAuthoringEvaluationOptions + = new AnalyzeConversationAuthoringEvaluationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringEvaluationOptions.kind + = EvaluationKind.fromString(reader.getString()); + } else if ("trainingSplitPercentage".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringEvaluationOptions.trainingSplitPercentage + = reader.getNullable(JsonReader::getInt); + } else if ("testingSplitPercentage".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringEvaluationOptions.testingSplitPercentage + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringEvaluationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationSummary.java new file mode 100644 index 000000000000..e804c777ee01 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringEvaluationSummary.java @@ -0,0 +1,132 @@ +// 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.conversations.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 summary. + */ +@Immutable +public final class AnalyzeConversationAuthoringEvaluationSummary + implements JsonSerializable { + /* + * Contains the data related to entities evaluation. + */ + @Generated + private final AnalyzeConversationAuthoringEntitiesEvaluationSummary entitiesEvaluation; + + /* + * Contains the data related to intents evaluation. + */ + @Generated + private final AnalyzeConversationAuthoringIntentsEvaluationSummary intentsEvaluation; + + /* + * The options that were used while running the evaluation. + */ + @Generated + private AnalyzeConversationAuthoringEvaluationOptions evaluationOptions; + + /** + * Creates an instance of AnalyzeConversationAuthoringEvaluationSummary class. + * + * @param entitiesEvaluation the entitiesEvaluation value to set. + * @param intentsEvaluation the intentsEvaluation value to set. + */ + @Generated + private AnalyzeConversationAuthoringEvaluationSummary( + AnalyzeConversationAuthoringEntitiesEvaluationSummary entitiesEvaluation, + AnalyzeConversationAuthoringIntentsEvaluationSummary intentsEvaluation) { + this.entitiesEvaluation = entitiesEvaluation; + this.intentsEvaluation = intentsEvaluation; + } + + /** + * Get the entitiesEvaluation property: Contains the data related to entities evaluation. + * + * @return the entitiesEvaluation value. + */ + @Generated + public AnalyzeConversationAuthoringEntitiesEvaluationSummary getEntitiesEvaluation() { + return this.entitiesEvaluation; + } + + /** + * Get the intentsEvaluation property: Contains the data related to intents evaluation. + * + * @return the intentsEvaluation value. + */ + @Generated + public AnalyzeConversationAuthoringIntentsEvaluationSummary getIntentsEvaluation() { + return this.intentsEvaluation; + } + + /** + * Get the evaluationOptions property: The options that were used while running the evaluation. + * + * @return the evaluationOptions value. + */ + @Generated + public AnalyzeConversationAuthoringEvaluationOptions getEvaluationOptions() { + return this.evaluationOptions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("entitiesEvaluation", this.entitiesEvaluation); + jsonWriter.writeJsonField("intentsEvaluation", this.intentsEvaluation); + jsonWriter.writeJsonField("evaluationOptions", this.evaluationOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringEvaluationSummary 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 AnalyzeConversationAuthoringEvaluationSummary. + */ + @Generated + public static AnalyzeConversationAuthoringEvaluationSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringEntitiesEvaluationSummary entitiesEvaluation = null; + AnalyzeConversationAuthoringIntentsEvaluationSummary intentsEvaluation = null; + AnalyzeConversationAuthoringEvaluationOptions evaluationOptions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entitiesEvaluation".equals(fieldName)) { + entitiesEvaluation = AnalyzeConversationAuthoringEntitiesEvaluationSummary.fromJson(reader); + } else if ("intentsEvaluation".equals(fieldName)) { + intentsEvaluation = AnalyzeConversationAuthoringIntentsEvaluationSummary.fromJson(reader); + } else if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = AnalyzeConversationAuthoringEvaluationOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringEvaluationSummary deserializedAnalyzeConversationAuthoringEvaluationSummary + = new AnalyzeConversationAuthoringEvaluationSummary(entitiesEvaluation, intentsEvaluation); + deserializedAnalyzeConversationAuthoringEvaluationSummary.evaluationOptions = evaluationOptions; + + return deserializedAnalyzeConversationAuthoringEvaluationSummary; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportProjectJobState.java new file mode 100644 index 000000000000..8a1b24ac1a5a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportProjectJobState.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.conversations.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 AnalyzeConversationAuthoringExportProjectJobState + 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 AnalyzeConversationAuthoringExportProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringExportProjectJobState(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 AnalyzeConversationAuthoringExportProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportProjectJobState 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 AnalyzeConversationAuthoringExportProjectJobState. + */ + @Generated + public static AnalyzeConversationAuthoringExportProjectJobState 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 -> Warning.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(); + } + } + AnalyzeConversationAuthoringExportProjectJobState deserializedAnalyzeConversationAuthoringExportProjectJobState + = new AnalyzeConversationAuthoringExportProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringExportProjectJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringExportProjectJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringExportProjectJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringExportProjectJobState.errors = errors; + deserializedAnalyzeConversationAuthoringExportProjectJobState.resultUrl = resultUrl; + + return deserializedAnalyzeConversationAuthoringExportProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestration.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestration.java new file mode 100644 index 000000000000..5e233b6eb613 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestration.java @@ -0,0 +1,108 @@ +// 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.conversations.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; + +/** + * Defines the orchestration details for a Conversational project target. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedConversationOrchestration + implements JsonSerializable { + /* + * The name of the targeted project. + */ + @Generated + private final String projectName; + + /* + * The name of the targeted deployment. + */ + @Generated + private final String deploymentName; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedConversationOrchestration class. + * + * @param projectName the projectName value to set. + * @param deploymentName the deploymentName value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedConversationOrchestration(String projectName, String deploymentName) { + this.projectName = projectName; + this.deploymentName = deploymentName; + } + + /** + * Get the projectName property: The name of the targeted project. + * + * @return the projectName value. + */ + @Generated + public String getProjectName() { + return this.projectName; + } + + /** + * Get the deploymentName property: The name of the targeted deployment. + * + * @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("projectName", this.projectName); + jsonWriter.writeStringField("deploymentName", this.deploymentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedConversationOrchestration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedConversationOrchestration 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 + * AnalyzeConversationAuthoringExportedConversationOrchestration. + */ + @Generated + public static AnalyzeConversationAuthoringExportedConversationOrchestration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String projectName = null; + String deploymentName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectName".equals(fieldName)) { + projectName = reader.getString(); + } else if ("deploymentName".equals(fieldName)) { + deploymentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringExportedConversationOrchestration(projectName, deploymentName); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestrationOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestrationOptions.java new file mode 100644 index 000000000000..bbb0384fc091 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedConversationOrchestrationOptions.java @@ -0,0 +1,114 @@ +// 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.conversations.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 orchestration options for a Conversational project target. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedConversationOrchestrationOptions + extends AnalyzeConversationAuthoringExportedOrchestrationOptions { + /* + * The targetProjectKind property. + */ + @Generated + private OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.CONVERSATION; + + /* + * The Conversational project target details. + */ + @Generated + private final AnalyzeConversationAuthoringExportedConversationOrchestration conversationOrchestration; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedConversationOrchestrationOptions class. + * + * @param conversationOrchestration the conversationOrchestration value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedConversationOrchestrationOptions( + AnalyzeConversationAuthoringExportedConversationOrchestration conversationOrchestration) { + this.conversationOrchestration = conversationOrchestration; + } + + /** + * Get the targetProjectKind property: The targetProjectKind property. + * + * @return the targetProjectKind value. + */ + @Generated + @Override + public OrchestrationTargetProjectKind getTargetProjectKind() { + return this.targetProjectKind; + } + + /** + * Get the conversationOrchestration property: The Conversational project target details. + * + * @return the conversationOrchestration value. + */ + @Generated + public AnalyzeConversationAuthoringExportedConversationOrchestration getConversationOrchestration() { + return this.conversationOrchestration; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("conversationOrchestration", this.conversationOrchestration); + jsonWriter.writeStringField("targetProjectKind", + this.targetProjectKind == null ? null : this.targetProjectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedConversationOrchestrationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedConversationOrchestrationOptions 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 + * AnalyzeConversationAuthoringExportedConversationOrchestrationOptions. + */ + @Generated + public static AnalyzeConversationAuthoringExportedConversationOrchestrationOptions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedConversationOrchestration conversationOrchestration = null; + OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.CONVERSATION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("conversationOrchestration".equals(fieldName)) { + conversationOrchestration + = AnalyzeConversationAuthoringExportedConversationOrchestration.fromJson(reader); + } else if ("targetProjectKind".equals(fieldName)) { + targetProjectKind = OrchestrationTargetProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedConversationOrchestrationOptions deserializedAnalyzeConversationAuthoringExportedConversationOrchestrationOptions + = new AnalyzeConversationAuthoringExportedConversationOrchestrationOptions(conversationOrchestration); + deserializedAnalyzeConversationAuthoringExportedConversationOrchestrationOptions.targetProjectKind + = targetProjectKind; + + return deserializedAnalyzeConversationAuthoringExportedConversationOrchestrationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityList.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityList.java new file mode 100644 index 000000000000..9c9bb3972fed --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityList.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.conversations.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 AnalyzeConversationAuthoringExportedEntityList + implements JsonSerializable { + /* + * The sub-lists of the list component. + */ + @Generated + private List sublists; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedEntityList class. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityList() { + } + + /** + * 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 AnalyzeConversationAuthoringExportedEntityList object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityList + 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 AnalyzeConversationAuthoringExportedEntityList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedEntityList 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 AnalyzeConversationAuthoringExportedEntityList. + */ + @Generated + public static AnalyzeConversationAuthoringExportedEntityList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedEntityList deserializedAnalyzeConversationAuthoringExportedEntityList + = new AnalyzeConversationAuthoringExportedEntityList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sublists".equals(fieldName)) { + List sublists = reader + .readArray(reader1 -> AnalyzeConversationAuthoringExportedEntitySublist.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringExportedEntityList.sublists = sublists; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedEntityList; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityListSynonym.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityListSynonym.java new file mode 100644 index 000000000000..fa2f554af634 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityListSynonym.java @@ -0,0 +1,131 @@ +// 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.conversations.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 AnalyzeConversationAuthoringExportedEntityListSynonym + 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 AnalyzeConversationAuthoringExportedEntityListSynonym class. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityListSynonym() { + } + + /** + * 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 AnalyzeConversationAuthoringExportedEntityListSynonym object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityListSynonym 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 AnalyzeConversationAuthoringExportedEntityListSynonym object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityListSynonym 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 AnalyzeConversationAuthoringExportedEntityListSynonym from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedEntityListSynonym 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 AnalyzeConversationAuthoringExportedEntityListSynonym. + */ + @Generated + public static AnalyzeConversationAuthoringExportedEntityListSynonym fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedEntityListSynonym deserializedAnalyzeConversationAuthoringExportedEntityListSynonym + = new AnalyzeConversationAuthoringExportedEntityListSynonym(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("language".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedEntityListSynonym.language = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedAnalyzeConversationAuthoringExportedEntityListSynonym.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedEntityListSynonym; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegex.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegex.java new file mode 100644 index 000000000000..9ba5323c0fd8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegex.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.conversations.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 regex component of an entity. + */ +@Fluent +public final class AnalyzeConversationAuthoringExportedEntityRegex + implements JsonSerializable { + /* + * The regex expressions of the regex component. These expressions follow the .NET regex syntax. For reference, + * check here: https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions + */ + @Generated + private List expressions; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedEntityRegex class. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegex() { + } + + /** + * Get the expressions property: The regex expressions of the regex component. These expressions follow the .NET + * regex syntax. For reference, check here: + * https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + * + * @return the expressions value. + */ + @Generated + public List getExpressions() { + return this.expressions; + } + + /** + * Set the expressions property: The regex expressions of the regex component. These expressions follow the .NET + * regex syntax. For reference, check here: + * https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + * + * @param expressions the expressions value to set. + * @return the AnalyzeConversationAuthoringExportedEntityRegex object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegex + setExpressions(List expressions) { + this.expressions = expressions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("expressions", this.expressions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedEntityRegex from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedEntityRegex 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 AnalyzeConversationAuthoringExportedEntityRegex. + */ + @Generated + public static AnalyzeConversationAuthoringExportedEntityRegex fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedEntityRegex deserializedAnalyzeConversationAuthoringExportedEntityRegex + = new AnalyzeConversationAuthoringExportedEntityRegex(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expressions".equals(fieldName)) { + List expressions = reader.readArray( + reader1 -> AnalyzeConversationAuthoringExportedEntityRegexExpression.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringExportedEntityRegex.expressions = expressions; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedEntityRegex; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegexExpression.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegexExpression.java new file mode 100644 index 000000000000..51288f81cbcd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntityRegexExpression.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.conversations.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 regex expression inside a regex component. This expression follows the .NET regex syntax. For reference, + * check here: https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + */ +@Fluent +public final class AnalyzeConversationAuthoringExportedEntityRegexExpression + implements JsonSerializable { + /* + * The key of the regex expression. + */ + @Generated + private String regexKey; + + /* + * Represents the language of the regex expression. 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 regex pattern. + */ + @Generated + private String regexPattern; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedEntityRegexExpression class. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegexExpression() { + } + + /** + * Get the regexKey property: The key of the regex expression. + * + * @return the regexKey value. + */ + @Generated + public String getRegexKey() { + return this.regexKey; + } + + /** + * Set the regexKey property: The key of the regex expression. + * + * @param regexKey the regexKey value to set. + * @return the AnalyzeConversationAuthoringExportedEntityRegexExpression object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegexExpression setRegexKey(String regexKey) { + this.regexKey = regexKey; + return this; + } + + /** + * Get the language property: Represents the language of the regex expression. 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 regex expression. 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 AnalyzeConversationAuthoringExportedEntityRegexExpression object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegexExpression setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the regexPattern property: The regex pattern. + * + * @return the regexPattern value. + */ + @Generated + public String getRegexPattern() { + return this.regexPattern; + } + + /** + * Set the regexPattern property: The regex pattern. + * + * @param regexPattern the regexPattern value to set. + * @return the AnalyzeConversationAuthoringExportedEntityRegexExpression object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntityRegexExpression setRegexPattern(String regexPattern) { + this.regexPattern = regexPattern; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("regexKey", this.regexKey); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("regexPattern", this.regexPattern); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedEntityRegexExpression from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedEntityRegexExpression 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 + * AnalyzeConversationAuthoringExportedEntityRegexExpression. + */ + @Generated + public static AnalyzeConversationAuthoringExportedEntityRegexExpression fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedEntityRegexExpression deserializedAnalyzeConversationAuthoringExportedEntityRegexExpression + = new AnalyzeConversationAuthoringExportedEntityRegexExpression(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regexKey".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedEntityRegexExpression.regexKey = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedEntityRegexExpression.language = reader.getString(); + } else if ("regexPattern".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedEntityRegexExpression.regexPattern + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedEntityRegexExpression; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntitySublist.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntitySublist.java new file mode 100644 index 000000000000..89ac9b1d2458 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedEntitySublist.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.conversations.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 AnalyzeConversationAuthoringExportedEntitySublist + 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 AnalyzeConversationAuthoringExportedEntitySublist class. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntitySublist() { + } + + /** + * 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 AnalyzeConversationAuthoringExportedEntitySublist object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntitySublist 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 AnalyzeConversationAuthoringExportedEntitySublist object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedEntitySublist + 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 AnalyzeConversationAuthoringExportedEntitySublist from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedEntitySublist 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 AnalyzeConversationAuthoringExportedEntitySublist. + */ + @Generated + public static AnalyzeConversationAuthoringExportedEntitySublist fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedEntitySublist deserializedAnalyzeConversationAuthoringExportedEntitySublist + = new AnalyzeConversationAuthoringExportedEntitySublist(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("listKey".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedEntitySublist.listKey = reader.getString(); + } else if ("synonyms".equals(fieldName)) { + List synonyms = reader + .readArray(reader1 -> AnalyzeConversationAuthoringExportedEntityListSynonym.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringExportedEntitySublist.synonyms = synonyms; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedEntitySublist; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestration.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestration.java new file mode 100644 index 000000000000..6d4e54e16f09 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestration.java @@ -0,0 +1,154 @@ +// 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.conversations.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; + +/** + * Defines the orchestration details for a LUIS application target. + */ +@Fluent +public final class AnalyzeConversationAuthoringExportedLuisOrchestration + implements JsonSerializable { + /* + * The LUIS application ID. + */ + @Generated + private final String appId; + + /* + * The targeted version Id. + */ + @Generated + private String appVersion; + + /* + * The targeted slot name. + */ + @Generated + private String slotName; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedLuisOrchestration class. + * + * @param appId the appId value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedLuisOrchestration(String appId) { + this.appId = appId; + } + + /** + * Get the appId property: The LUIS application ID. + * + * @return the appId value. + */ + @Generated + public String getAppId() { + return this.appId; + } + + /** + * Get the appVersion property: The targeted version Id. + * + * @return the appVersion value. + */ + @Generated + public String getAppVersion() { + return this.appVersion; + } + + /** + * Set the appVersion property: The targeted version Id. + * + * @param appVersion the appVersion value to set. + * @return the AnalyzeConversationAuthoringExportedLuisOrchestration object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedLuisOrchestration setAppVersion(String appVersion) { + this.appVersion = appVersion; + return this; + } + + /** + * Get the slotName property: The targeted slot name. + * + * @return the slotName value. + */ + @Generated + public String getSlotName() { + return this.slotName; + } + + /** + * Set the slotName property: The targeted slot name. + * + * @param slotName the slotName value to set. + * @return the AnalyzeConversationAuthoringExportedLuisOrchestration object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedLuisOrchestration setSlotName(String slotName) { + this.slotName = slotName; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("appVersion", this.appVersion); + jsonWriter.writeStringField("slotName", this.slotName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedLuisOrchestration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedLuisOrchestration 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 AnalyzeConversationAuthoringExportedLuisOrchestration. + */ + @Generated + public static AnalyzeConversationAuthoringExportedLuisOrchestration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String appId = null; + String appVersion = null; + String slotName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appId".equals(fieldName)) { + appId = reader.getString(); + } else if ("appVersion".equals(fieldName)) { + appVersion = reader.getString(); + } else if ("slotName".equals(fieldName)) { + slotName = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedLuisOrchestration deserializedAnalyzeConversationAuthoringExportedLuisOrchestration + = new AnalyzeConversationAuthoringExportedLuisOrchestration(appId); + deserializedAnalyzeConversationAuthoringExportedLuisOrchestration.appVersion = appVersion; + deserializedAnalyzeConversationAuthoringExportedLuisOrchestration.slotName = slotName; + + return deserializedAnalyzeConversationAuthoringExportedLuisOrchestration; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestrationOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestrationOptions.java new file mode 100644 index 000000000000..638eb9ca1932 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedLuisOrchestrationOptions.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.conversations.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 orchestration options for a LUIS application target. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedLuisOrchestrationOptions + extends AnalyzeConversationAuthoringExportedOrchestrationOptions { + /* + * The targetProjectKind property. + */ + @Generated + private OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.LUIS; + + /* + * The LUIS application target details. + */ + @Generated + private final AnalyzeConversationAuthoringExportedLuisOrchestration luisOrchestration; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedLuisOrchestrationOptions class. + * + * @param luisOrchestration the luisOrchestration value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedLuisOrchestrationOptions( + AnalyzeConversationAuthoringExportedLuisOrchestration luisOrchestration) { + this.luisOrchestration = luisOrchestration; + } + + /** + * Get the targetProjectKind property: The targetProjectKind property. + * + * @return the targetProjectKind value. + */ + @Generated + @Override + public OrchestrationTargetProjectKind getTargetProjectKind() { + return this.targetProjectKind; + } + + /** + * Get the luisOrchestration property: The LUIS application target details. + * + * @return the luisOrchestration value. + */ + @Generated + public AnalyzeConversationAuthoringExportedLuisOrchestration getLuisOrchestration() { + return this.luisOrchestration; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("luisOrchestration", this.luisOrchestration); + jsonWriter.writeStringField("targetProjectKind", + this.targetProjectKind == null ? null : this.targetProjectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedLuisOrchestrationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedLuisOrchestrationOptions 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 + * AnalyzeConversationAuthoringExportedLuisOrchestrationOptions. + */ + @Generated + public static AnalyzeConversationAuthoringExportedLuisOrchestrationOptions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedLuisOrchestration luisOrchestration = null; + OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.LUIS; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("luisOrchestration".equals(fieldName)) { + luisOrchestration = AnalyzeConversationAuthoringExportedLuisOrchestration.fromJson(reader); + } else if ("targetProjectKind".equals(fieldName)) { + targetProjectKind = OrchestrationTargetProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedLuisOrchestrationOptions deserializedAnalyzeConversationAuthoringExportedLuisOrchestrationOptions + = new AnalyzeConversationAuthoringExportedLuisOrchestrationOptions(luisOrchestration); + deserializedAnalyzeConversationAuthoringExportedLuisOrchestrationOptions.targetProjectKind + = targetProjectKind; + + return deserializedAnalyzeConversationAuthoringExportedLuisOrchestrationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedModelJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedModelJobState.java new file mode 100644 index 000000000000..143952aff46a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedModelJobState.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.conversations.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 AnalyzeConversationAuthoringExportedModelJobState + 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 AnalyzeConversationAuthoringExportedModelJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringExportedModelJobState(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 AnalyzeConversationAuthoringExportedModelJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedModelJobState 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 AnalyzeConversationAuthoringExportedModelJobState. + */ + @Generated + public static AnalyzeConversationAuthoringExportedModelJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedModelJobState deserializedAnalyzeConversationAuthoringExportedModelJobState + = new AnalyzeConversationAuthoringExportedModelJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringExportedModelJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringExportedModelJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringExportedModelJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringExportedModelJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringExportedModelJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedOrchestrationOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedOrchestrationOptions.java new file mode 100644 index 000000000000..be4c7340af2e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedOrchestrationOptions.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.conversations.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 used to define the orchestration behavior of an intent. + */ +@Immutable +public class AnalyzeConversationAuthoringExportedOrchestrationOptions + implements JsonSerializable { + /* + * The targetProjectKind property. + */ + @Generated + private OrchestrationTargetProjectKind targetProjectKind + = OrchestrationTargetProjectKind.fromString("AnalyzeConversationAuthoringExportedOrchestrationOptions"); + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedOrchestrationOptions class. + */ + @Generated + public AnalyzeConversationAuthoringExportedOrchestrationOptions() { + } + + /** + * Get the targetProjectKind property: The targetProjectKind property. + * + * @return the targetProjectKind value. + */ + @Generated + public OrchestrationTargetProjectKind getTargetProjectKind() { + return this.targetProjectKind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetProjectKind", + this.targetProjectKind == null ? null : this.targetProjectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedOrchestrationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedOrchestrationOptions 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 + * AnalyzeConversationAuthoringExportedOrchestrationOptions. + */ + @Generated + public static AnalyzeConversationAuthoringExportedOrchestrationOptions 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 ("targetProjectKind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Conversation".equals(discriminatorValue)) { + return AnalyzeConversationAuthoringExportedConversationOrchestrationOptions + .fromJson(readerToUse.reset()); + } else if ("Luis".equals(discriminatorValue)) { + return AnalyzeConversationAuthoringExportedLuisOrchestrationOptions.fromJson(readerToUse.reset()); + } else if ("QuestionAnswering".equals(discriminatorValue)) { + return AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions + .fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static AnalyzeConversationAuthoringExportedOrchestrationOptions fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedOrchestrationOptions deserializedAnalyzeConversationAuthoringExportedOrchestrationOptions + = new AnalyzeConversationAuthoringExportedOrchestrationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetProjectKind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedOrchestrationOptions.targetProjectKind + = OrchestrationTargetProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedOrchestrationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedPrebuiltEntity.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedPrebuiltEntity.java new file mode 100644 index 000000000000..7b21cad05d62 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedPrebuiltEntity.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.conversations.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 AnalyzeConversationAuthoringExportedPrebuiltEntity + implements JsonSerializable { + /* + * The prebuilt entity category. + */ + @Generated + private final String category; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedPrebuiltEntity class. + * + * @param category the category value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedPrebuiltEntity(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 AnalyzeConversationAuthoringExportedPrebuiltEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedPrebuiltEntity 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 AnalyzeConversationAuthoringExportedPrebuiltEntity. + */ + @Generated + public static AnalyzeConversationAuthoringExportedPrebuiltEntity 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 AnalyzeConversationAuthoringExportedPrebuiltEntity(category); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProject.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProject.java new file mode 100644 index 000000000000..ae6ca6cf573c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProject.java @@ -0,0 +1,169 @@ +// 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.conversations.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 AnalyzeConversationAuthoringExportedProject + 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 AnalyzeConversationAuthoringCreateProjectOptions metadata; + + /* + * Represents the project assets. + */ + @Generated + private AnalyzeConversationAuthoringExportedProjectAssets assets; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedProject class. + * + * @param projectFileVersion the projectFileVersion value to set. + * @param stringIndexType the stringIndexType value to set. + * @param metadata the metadata value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedProject(String projectFileVersion, StringIndexType stringIndexType, + AnalyzeConversationAuthoringCreateProjectOptions 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 AnalyzeConversationAuthoringCreateProjectOptions getMetadata() { + return this.metadata; + } + + /** + * Get the assets property: Represents the project assets. + * + * @return the assets value. + */ + @Generated + public AnalyzeConversationAuthoringExportedProjectAssets getAssets() { + return this.assets; + } + + /** + * Set the assets property: Represents the project assets. + * + * @param assets the assets value to set. + * @return the AnalyzeConversationAuthoringExportedProject object itself. + */ + @Generated + public AnalyzeConversationAuthoringExportedProject + setAssets(AnalyzeConversationAuthoringExportedProjectAssets 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 AnalyzeConversationAuthoringExportedProject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedProject 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 AnalyzeConversationAuthoringExportedProject. + */ + @Generated + public static AnalyzeConversationAuthoringExportedProject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String projectFileVersion = null; + StringIndexType stringIndexType = null; + AnalyzeConversationAuthoringCreateProjectOptions metadata = null; + AnalyzeConversationAuthoringExportedProjectAssets 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 = AnalyzeConversationAuthoringCreateProjectOptions.fromJson(reader); + } else if ("assets".equals(fieldName)) { + assets = AnalyzeConversationAuthoringExportedProjectAssets.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedProject deserializedAnalyzeConversationAuthoringExportedProject + = new AnalyzeConversationAuthoringExportedProject(projectFileVersion, stringIndexType, metadata); + deserializedAnalyzeConversationAuthoringExportedProject.assets = assets; + + return deserializedAnalyzeConversationAuthoringExportedProject; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProjectAssets.java new file mode 100644 index 000000000000..893db09d2207 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedProjectAssets.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.conversations.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 AnalyzeConversationAuthoringExportedProjectAssets + implements JsonSerializable { + /* + * The type of project containing the assets. + */ + @Generated + private ProjectKind projectKind = ProjectKind.fromString("AnalyzeConversationAuthoringExportedProjectAssets"); + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedProjectAssets class. + */ + @Generated + public AnalyzeConversationAuthoringExportedProjectAssets() { + } + + /** + * Get the projectKind property: The type of project containing the assets. + * + * @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 AnalyzeConversationAuthoringExportedProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedProjectAssets 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 AnalyzeConversationAuthoringExportedProjectAssets. + */ + @Generated + public static AnalyzeConversationAuthoringExportedProjectAssets 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 ("Conversation".equals(discriminatorValue)) { + return AnalyzeConversationAuthoringConversationExportedProjectAssets.fromJson(readerToUse.reset()); + } else if ("Orchestration".equals(discriminatorValue)) { + return AnalyzeConversationAuthoringOrchestrationExportedProjectAssets.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static AnalyzeConversationAuthoringExportedProjectAssets fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedProjectAssets deserializedAnalyzeConversationAuthoringExportedProjectAssets + = new AnalyzeConversationAuthoringExportedProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringExportedProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringExportedProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration.java new file mode 100644 index 000000000000..f566d12efd41 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration.java @@ -0,0 +1,86 @@ +// 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.conversations.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; + +/** + * Defines the orchestration details for a Question Answering project target. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration + implements JsonSerializable { + /* + * The name of the target project. + */ + @Generated + private final String projectName; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration class. + * + * @param projectName the projectName value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration(String projectName) { + this.projectName = projectName; + } + + /** + * Get the projectName property: The name of the target project. + * + * @return the projectName value. + */ + @Generated + public String getProjectName() { + return this.projectName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectName", this.projectName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration 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 + * AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration. + */ + @Generated + public static AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String projectName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectName".equals(fieldName)) { + projectName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration(projectName); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions.java new file mode 100644 index 000000000000..e23c35c80100 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions.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.conversations.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 orchestration options for a Question Answering project target. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions + extends AnalyzeConversationAuthoringExportedOrchestrationOptions { + /* + * The targetProjectKind property. + */ + @Generated + private OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.QUESTION_ANSWERING; + + /* + * The Question Answering project details. + */ + @Generated + private final AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration questionAnsweringOrchestration; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions class. + * + * @param questionAnsweringOrchestration the questionAnsweringOrchestration value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions( + AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) { + this.questionAnsweringOrchestration = questionAnsweringOrchestration; + } + + /** + * Get the targetProjectKind property: The targetProjectKind property. + * + * @return the targetProjectKind value. + */ + @Generated + @Override + public OrchestrationTargetProjectKind getTargetProjectKind() { + return this.targetProjectKind; + } + + /** + * Get the questionAnsweringOrchestration property: The Question Answering project details. + * + * @return the questionAnsweringOrchestration value. + */ + @Generated + public AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration getQuestionAnsweringOrchestration() { + return this.questionAnsweringOrchestration; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("questionAnsweringOrchestration", this.questionAnsweringOrchestration); + jsonWriter.writeStringField("targetProjectKind", + this.targetProjectKind == null ? null : this.targetProjectKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions 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 + * AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions. + */ + @Generated + public static AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null; + OrchestrationTargetProjectKind targetProjectKind = OrchestrationTargetProjectKind.QUESTION_ANSWERING; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("questionAnsweringOrchestration".equals(fieldName)) { + questionAnsweringOrchestration + = AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration.fromJson(reader); + } else if ("targetProjectKind".equals(fieldName)) { + targetProjectKind = OrchestrationTargetProjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions deserializedAnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions + = new AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions( + questionAnsweringOrchestration); + deserializedAnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions.targetProjectKind + = targetProjectKind; + + return deserializedAnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedTrainedModel.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedTrainedModel.java new file mode 100644 index 000000000000..5d070e6fb1bb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedTrainedModel.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.conversations.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 AnalyzeConversationAuthoringExportedTrainedModel + 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 AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel(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 AnalyzeConversationAuthoringExportedTrainedModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedTrainedModel 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 AnalyzeConversationAuthoringExportedTrainedModel. + */ + @Generated + public static AnalyzeConversationAuthoringExportedTrainedModel 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(); + } + } + AnalyzeConversationAuthoringExportedTrainedModel deserializedAnalyzeConversationAuthoringExportedTrainedModel + = new AnalyzeConversationAuthoringExportedTrainedModel(modelId, lastTrainedDateTime, + lastExportedModelDateTime, modelExpirationDate, modelTrainingConfigVersion); + deserializedAnalyzeConversationAuthoringExportedTrainedModel.exportedModelName = exportedModelName; + + return deserializedAnalyzeConversationAuthoringExportedTrainedModel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedUtteranceEntityLabel.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedUtteranceEntityLabel.java new file mode 100644 index 000000000000..18c11d6901f8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringExportedUtteranceEntityLabel.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.conversations.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 entity label for an utterance. + */ +@Immutable +public final class AnalyzeConversationAuthoringExportedUtteranceEntityLabel + implements JsonSerializable { + /* + * The category of the entity label. + */ + @Generated + private final String category; + + /* + * Start position for the entity text. + */ + @Generated + private final int offset; + + /* + * Length for the entity text. + */ + @Generated + private final int length; + + /** + * Creates an instance of AnalyzeConversationAuthoringExportedUtteranceEntityLabel class. + * + * @param category the category value to set. + * @param offset the offset value to set. + * @param length the length value to set. + */ + @Generated + public AnalyzeConversationAuthoringExportedUtteranceEntityLabel(String category, int offset, int length) { + this.category = category; + this.offset = offset; + this.length = length; + } + + /** + * Get the category property: The category of the entity label. + * + * @return the category value. + */ + @Generated + public String getCategory() { + return this.category; + } + + /** + * Get the offset property: Start position for the entity text. + * + * @return the offset value. + */ + @Generated + public int getOffset() { + return this.offset; + } + + /** + * Get the length property: Length for the entity text. + * + * @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 AnalyzeConversationAuthoringExportedUtteranceEntityLabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringExportedUtteranceEntityLabel 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 + * AnalyzeConversationAuthoringExportedUtteranceEntityLabel. + */ + @Generated + public static AnalyzeConversationAuthoringExportedUtteranceEntityLabel 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 AnalyzeConversationAuthoringExportedUtteranceEntityLabel(category, offset, length); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringImportProjectJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringImportProjectJobState.java new file mode 100644 index 000000000000..25f0410a1e2b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringImportProjectJobState.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.conversations.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 AnalyzeConversationAuthoringImportProjectJobState + 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 AnalyzeConversationAuthoringImportProjectJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringImportProjectJobState(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 AnalyzeConversationAuthoringImportProjectJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringImportProjectJobState 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 AnalyzeConversationAuthoringImportProjectJobState. + */ + @Generated + public static AnalyzeConversationAuthoringImportProjectJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringImportProjectJobState deserializedAnalyzeConversationAuthoringImportProjectJobState + = new AnalyzeConversationAuthoringImportProjectJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringImportProjectJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringImportProjectJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringImportProjectJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringImportProjectJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringImportProjectJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentEvaluationSummary.java new file mode 100644 index 000000000000..bf2db0f6ead4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentEvaluationSummary.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.conversations.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 evaluation summary for an intent. + */ +@Immutable +public final class AnalyzeConversationAuthoringIntentEvaluationSummary + 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 AnalyzeConversationAuthoringIntentEvaluationSummary 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 AnalyzeConversationAuthoringIntentEvaluationSummary(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 AnalyzeConversationAuthoringIntentEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringIntentEvaluationSummary 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 AnalyzeConversationAuthoringIntentEvaluationSummary. + */ + @Generated + public static AnalyzeConversationAuthoringIntentEvaluationSummary 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 AnalyzeConversationAuthoringIntentEvaluationSummary(f1, precision, recall, truePositiveCount, + trueNegativeCount, falsePositiveCount, falseNegativeCount); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentsEvaluationSummary.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentsEvaluationSummary.java new file mode 100644 index 000000000000..1dd8ab54c462 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringIntentsEvaluationSummary.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.conversations.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 the project's intents. + */ +@Immutable +public final class AnalyzeConversationAuthoringIntentsEvaluationSummary + implements JsonSerializable { + /* + * Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the + * intent that was labelled and the intent that was predicted. + */ + @Generated + private final AnalyzeConversationAuthoringConfusionMatrix confusionMatrix; + + /* + * Represents the intents evaluation summary. + */ + @Generated + private final Map intents; + + /* + * 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 AnalyzeConversationAuthoringIntentsEvaluationSummary class. + * + * @param confusionMatrix the confusionMatrix value to set. + * @param intents the intents 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 AnalyzeConversationAuthoringIntentsEvaluationSummary( + AnalyzeConversationAuthoringConfusionMatrix confusionMatrix, + Map intents, double microF1, double microPrecision, + double microRecall, double macroF1, double macroPrecision, double macroRecall) { + this.confusionMatrix = confusionMatrix; + this.intents = intents; + 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 intents (the two intents can be the + * same). The matrix is between the intent that was labelled and the intent that was predicted. + * + * @return the confusionMatrix value. + */ + @Generated + public AnalyzeConversationAuthoringConfusionMatrix getConfusionMatrix() { + return this.confusionMatrix; + } + + /** + * Get the intents property: Represents the intents evaluation summary. + * + * @return the intents value. + */ + @Generated + public Map getIntents() { + return this.intents; + } + + /** + * 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("intents", this.intents, (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 AnalyzeConversationAuthoringIntentsEvaluationSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringIntentsEvaluationSummary 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 AnalyzeConversationAuthoringIntentsEvaluationSummary. + */ + @Generated + public static AnalyzeConversationAuthoringIntentsEvaluationSummary fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringConfusionMatrix confusionMatrix = null; + Map intents = 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 = AnalyzeConversationAuthoringConfusionMatrix.fromJson(reader); + } else if ("intents".equals(fieldName)) { + intents = reader + .readMap(reader1 -> AnalyzeConversationAuthoringIntentEvaluationSummary.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 AnalyzeConversationAuthoringIntentsEvaluationSummary(confusionMatrix, intents, microF1, + microPrecision, microRecall, macroF1, macroPrecision, macroRecall); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringLoadSnapshotJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringLoadSnapshotJobState.java new file mode 100644 index 000000000000..85780ab2c08a --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringLoadSnapshotJobState.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.conversations.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 AnalyzeConversationAuthoringLoadSnapshotJobState + 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 AnalyzeConversationAuthoringLoadSnapshotJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringLoadSnapshotJobState(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 AnalyzeConversationAuthoringLoadSnapshotJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringLoadSnapshotJobState 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 AnalyzeConversationAuthoringLoadSnapshotJobState. + */ + @Generated + public static AnalyzeConversationAuthoringLoadSnapshotJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringLoadSnapshotJobState deserializedAnalyzeConversationAuthoringLoadSnapshotJobState + = new AnalyzeConversationAuthoringLoadSnapshotJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringLoadSnapshotJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringLoadSnapshotJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringLoadSnapshotJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringLoadSnapshotJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringLoadSnapshotJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedIntent.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedIntent.java new file mode 100644 index 000000000000..ba590549c4b2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedIntent.java @@ -0,0 +1,122 @@ +// 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.conversations.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 intent for an orchestration project. + */ +@Fluent +public final class AnalyzeConversationAuthoringOrchestrationExportedIntent + implements JsonSerializable { + /* + * Specifies the behavior of this intent in the orchestration flow. + */ + @Generated + private AnalyzeConversationAuthoringExportedOrchestrationOptions orchestration; + + /* + * The intent category. + */ + @Generated + private final String category; + + /** + * Creates an instance of AnalyzeConversationAuthoringOrchestrationExportedIntent class. + * + * @param category the category value to set. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedIntent(String category) { + this.category = category; + } + + /** + * Get the orchestration property: Specifies the behavior of this intent in the orchestration flow. + * + * @return the orchestration value. + */ + @Generated + public AnalyzeConversationAuthoringExportedOrchestrationOptions getOrchestration() { + return this.orchestration; + } + + /** + * Set the orchestration property: Specifies the behavior of this intent in the orchestration flow. + * + * @param orchestration the orchestration value to set. + * @return the AnalyzeConversationAuthoringOrchestrationExportedIntent object itself. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedIntent + setOrchestration(AnalyzeConversationAuthoringExportedOrchestrationOptions orchestration) { + this.orchestration = orchestration; + return this; + } + + /** + * Get the category property: The intent 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); + jsonWriter.writeJsonField("orchestration", this.orchestration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringOrchestrationExportedIntent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringOrchestrationExportedIntent 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 AnalyzeConversationAuthoringOrchestrationExportedIntent. + */ + @Generated + public static AnalyzeConversationAuthoringOrchestrationExportedIntent fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String category = null; + AnalyzeConversationAuthoringExportedOrchestrationOptions orchestration = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = reader.getString(); + } else if ("orchestration".equals(fieldName)) { + orchestration = AnalyzeConversationAuthoringExportedOrchestrationOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringOrchestrationExportedIntent deserializedAnalyzeConversationAuthoringOrchestrationExportedIntent + = new AnalyzeConversationAuthoringOrchestrationExportedIntent(category); + deserializedAnalyzeConversationAuthoringOrchestrationExportedIntent.orchestration = orchestration; + + return deserializedAnalyzeConversationAuthoringOrchestrationExportedIntent; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedProjectAssets.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedProjectAssets.java new file mode 100644 index 000000000000..4113c9ddccdb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedProjectAssets.java @@ -0,0 +1,154 @@ +// 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.conversations.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 assets of an orchestration project. + */ +@Fluent +public final class AnalyzeConversationAuthoringOrchestrationExportedProjectAssets + extends AnalyzeConversationAuthoringExportedProjectAssets { + /* + * The type of project containing the assets. + */ + @Generated + private ProjectKind projectKind = ProjectKind.ORCHESTRATION; + + /* + * Represents the intents of the project. + */ + @Generated + private List intents; + + /* + * Represents the utterances of the project. + */ + @Generated + private List utterances; + + /** + * Creates an instance of AnalyzeConversationAuthoringOrchestrationExportedProjectAssets class. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedProjectAssets() { + } + + /** + * Get the projectKind property: The type of project containing the assets. + * + * @return the projectKind value. + */ + @Generated + @Override + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the intents property: Represents the intents of the project. + * + * @return the intents value. + */ + @Generated + public List getIntents() { + return this.intents; + } + + /** + * Set the intents property: Represents the intents of the project. + * + * @param intents the intents value to set. + * @return the AnalyzeConversationAuthoringOrchestrationExportedProjectAssets object itself. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedProjectAssets + setIntents(List intents) { + this.intents = intents; + return this; + } + + /** + * Get the utterances property: Represents the utterances of the project. + * + * @return the utterances value. + */ + @Generated + public List getUtterances() { + return this.utterances; + } + + /** + * Set the utterances property: Represents the utterances of the project. + * + * @param utterances the utterances value to set. + * @return the AnalyzeConversationAuthoringOrchestrationExportedProjectAssets object itself. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedProjectAssets + setUtterances(List utterances) { + this.utterances = utterances; + 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("intents", this.intents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("utterances", this.utterances, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringOrchestrationExportedProjectAssets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringOrchestrationExportedProjectAssets 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 + * AnalyzeConversationAuthoringOrchestrationExportedProjectAssets. + */ + @Generated + public static AnalyzeConversationAuthoringOrchestrationExportedProjectAssets fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringOrchestrationExportedProjectAssets deserializedAnalyzeConversationAuthoringOrchestrationExportedProjectAssets + = new AnalyzeConversationAuthoringOrchestrationExportedProjectAssets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectKind".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringOrchestrationExportedProjectAssets.projectKind + = ProjectKind.fromString(reader.getString()); + } else if ("intents".equals(fieldName)) { + List intents = reader.readArray( + reader1 -> AnalyzeConversationAuthoringOrchestrationExportedIntent.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringOrchestrationExportedProjectAssets.intents = intents; + } else if ("utterances".equals(fieldName)) { + List utterances = reader.readArray( + reader1 -> AnalyzeConversationAuthoringOrchestrationExportedUtterance.fromJson(reader1)); + deserializedAnalyzeConversationAuthoringOrchestrationExportedProjectAssets.utterances = utterances; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringOrchestrationExportedProjectAssets; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedUtterance.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedUtterance.java new file mode 100644 index 000000000000..6d6cab73b3d5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringOrchestrationExportedUtterance.java @@ -0,0 +1,180 @@ +// 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.conversations.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 utterance of an orchestration project. + */ +@Fluent +public final class AnalyzeConversationAuthoringOrchestrationExportedUtterance + implements JsonSerializable { + /* + * The utterance text. + */ + @Generated + private final String text; + + /* + * Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for + * English, "en-gb" for English (UK), "es" for Spanish etc. + */ + @Generated + private String language; + + /* + * The intent of the utterance. + */ + @Generated + private final String intent; + + /* + * The dataset for this utterance. Allowed values are 'Train' and 'Test'. + */ + @Generated + private String dataset; + + /** + * Creates an instance of AnalyzeConversationAuthoringOrchestrationExportedUtterance class. + * + * @param text the text value to set. + * @param intent the intent value to set. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedUtterance(String text, String intent) { + this.text = text; + this.intent = intent; + } + + /** + * Get the text property: The utterance text. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Get the language property: Represents the utterance's language. This is BCP-47 representation of a language. For + * example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: Represents the utterance's language. This is BCP-47 representation of a language. For + * example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + * + * @param language the language value to set. + * @return the AnalyzeConversationAuthoringOrchestrationExportedUtterance object itself. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedUtterance setLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the intent property: The intent of the utterance. + * + * @return the intent value. + */ + @Generated + public String getIntent() { + return this.intent; + } + + /** + * Get the dataset property: The dataset for this utterance. 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 utterance. Allowed values are 'Train' and 'Test'. + * + * @param dataset the dataset value to set. + * @return the AnalyzeConversationAuthoringOrchestrationExportedUtterance object itself. + */ + @Generated + public AnalyzeConversationAuthoringOrchestrationExportedUtterance setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("intent", this.intent); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("dataset", this.dataset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringOrchestrationExportedUtterance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringOrchestrationExportedUtterance 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 + * AnalyzeConversationAuthoringOrchestrationExportedUtterance. + */ + @Generated + public static AnalyzeConversationAuthoringOrchestrationExportedUtterance fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + String intent = null; + String language = null; + String dataset = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("intent".equals(fieldName)) { + intent = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("dataset".equals(fieldName)) { + dataset = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringOrchestrationExportedUtterance deserializedAnalyzeConversationAuthoringOrchestrationExportedUtterance + = new AnalyzeConversationAuthoringOrchestrationExportedUtterance(text, intent); + deserializedAnalyzeConversationAuthoringOrchestrationExportedUtterance.language = language; + deserializedAnalyzeConversationAuthoringOrchestrationExportedUtterance.dataset = dataset; + + return deserializedAnalyzeConversationAuthoringOrchestrationExportedUtterance; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntities.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntities.java new file mode 100644 index 000000000000..5ff91b563f8f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntities.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.conversations.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 a list of the retrieved supported prebuilt entities. + */ +@Immutable +public final class AnalyzeConversationAuthoringPrebuiltEntities + implements JsonSerializable { + /* + * The supported prebuilt entities. + */ + @Generated + private final List value; + + /* + * The next page link. + */ + @Generated + private String nextLink; + + /** + * Creates an instance of AnalyzeConversationAuthoringPrebuiltEntities class. + * + * @param value the value value to set. + */ + @Generated + private AnalyzeConversationAuthoringPrebuiltEntities(List value) { + this.value = value; + } + + /** + * Get the value property: The supported prebuilt entities. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: The next page link. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringPrebuiltEntities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringPrebuiltEntities 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 AnalyzeConversationAuthoringPrebuiltEntities. + */ + @Generated + public static AnalyzeConversationAuthoringPrebuiltEntities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> AnalyzeConversationAuthoringPrebuiltEntity.fromJson(reader1)); + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringPrebuiltEntities deserializedAnalyzeConversationAuthoringPrebuiltEntities + = new AnalyzeConversationAuthoringPrebuiltEntities(value); + deserializedAnalyzeConversationAuthoringPrebuiltEntities.nextLink = nextLink; + + return deserializedAnalyzeConversationAuthoringPrebuiltEntities; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntity.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntity.java new file mode 100644 index 000000000000..17f6a375f30f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringPrebuiltEntity.java @@ -0,0 +1,128 @@ +// 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.conversations.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 AnalyzeConversationAuthoringPrebuiltEntity + implements JsonSerializable { + /* + * The prebuilt entity category. + */ + @Generated + private final String category; + + /* + * The description. + */ + @Generated + private final String description; + + /* + * English examples for the entity. + */ + @Generated + private final String examples; + + /** + * Creates an instance of AnalyzeConversationAuthoringPrebuiltEntity class. + * + * @param category the category value to set. + * @param description the description value to set. + * @param examples the examples value to set. + */ + @Generated + private AnalyzeConversationAuthoringPrebuiltEntity(String category, String description, String examples) { + this.category = category; + 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("category", this.category); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("examples", this.examples); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringPrebuiltEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringPrebuiltEntity 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 AnalyzeConversationAuthoringPrebuiltEntity. + */ + @Generated + public static AnalyzeConversationAuthoringPrebuiltEntity 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(); + } + } + return new AnalyzeConversationAuthoringPrebuiltEntity(category, description, examples); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeletionJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeletionJobState.java new file mode 100644 index 000000000000..10c932335257 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeletionJobState.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.conversations.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 AnalyzeConversationAuthoringProjectDeletionJobState + 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 AnalyzeConversationAuthoringProjectDeletionJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringProjectDeletionJobState(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 AnalyzeConversationAuthoringProjectDeletionJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringProjectDeletionJobState 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 AnalyzeConversationAuthoringProjectDeletionJobState. + */ + @Generated + public static AnalyzeConversationAuthoringProjectDeletionJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringProjectDeletionJobState deserializedAnalyzeConversationAuthoringProjectDeletionJobState + = new AnalyzeConversationAuthoringProjectDeletionJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringProjectDeletionJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringProjectDeletionJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringProjectDeletionJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringProjectDeletionJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringProjectDeletionJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeployment.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeployment.java new file mode 100644 index 000000000000..7b2ea94bf006 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectDeployment.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.conversations.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 AnalyzeConversationAuthoringProjectDeployment + 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 AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment(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 AnalyzeConversationAuthoringProjectDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringProjectDeployment 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 AnalyzeConversationAuthoringProjectDeployment. + */ + @Generated + public static AnalyzeConversationAuthoringProjectDeployment 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 -> AnalyzeConversationAuthoringDeploymentResource.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringProjectDeployment deserializedAnalyzeConversationAuthoringProjectDeployment + = new AnalyzeConversationAuthoringProjectDeployment(modelId, lastTrainedDateTime, lastDeployedDateTime, + deploymentExpirationDate, modelTrainingConfigVersion, assignedResources); + deserializedAnalyzeConversationAuthoringProjectDeployment.deploymentName = deploymentName; + + return deserializedAnalyzeConversationAuthoringProjectDeployment; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectMetadata.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectMetadata.java new file mode 100644 index 000000000000..5fa7b45a037d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectMetadata.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.conversations.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 AnalyzeConversationAuthoringProjectMetadata + implements JsonSerializable { + /* + * Represents the project creation datetime. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * Represents the project creation datetime. + */ + @Generated + private final OffsetDateTime lastModifiedDateTime; + + /* + * Represents the project last trained datetime. + */ + @Generated + private OffsetDateTime lastTrainedDateTime; + + /* + * Represents the project last deployed datetime. + */ + @Generated + private OffsetDateTime lastDeployedDateTime; + + /* + * Represents the project kind. + */ + @Generated + private final ProjectKind projectKind; + + /* + * The project settings. + */ + @Generated + private AnalyzeConversationAuthoringProjectSettings settings; + + /* + * The storage container name in case of conversation summarization. + */ + @Generated + private String storageInputContainerName; + + /* + * 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 AnalyzeConversationAuthoringProjectMetadata class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastModifiedDateTime the lastModifiedDateTime value to set. + * @param projectKind the projectKind value to set. + * @param language the language value to set. + */ + @Generated + private AnalyzeConversationAuthoringProjectMetadata(OffsetDateTime createdDateTime, + OffsetDateTime lastModifiedDateTime, ProjectKind projectKind, String language) { + this.createdDateTime = createdDateTime; + this.lastModifiedDateTime = lastModifiedDateTime; + this.projectKind = projectKind; + 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 creation datetime. + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastTrainedDateTime property: Represents the project last trained datetime. + * + * @return the lastTrainedDateTime value. + */ + @Generated + public OffsetDateTime getLastTrainedDateTime() { + return this.lastTrainedDateTime; + } + + /** + * Get the lastDeployedDateTime property: Represents the project last deployed datetime. + * + * @return the lastDeployedDateTime value. + */ + @Generated + public OffsetDateTime getLastDeployedDateTime() { + return this.lastDeployedDateTime; + } + + /** + * Get the projectKind property: Represents the project kind. + * + * @return the projectKind value. + */ + @Generated + public ProjectKind getProjectKind() { + return this.projectKind; + } + + /** + * Get the settings property: The project settings. + * + * @return the settings value. + */ + @Generated + public AnalyzeConversationAuthoringProjectSettings getSettings() { + return this.settings; + } + + /** + * Get the storageInputContainerName property: The storage container name in case of conversation summarization. + * + * @return the storageInputContainerName value. + */ + @Generated + public String getStorageInputContainerName() { + return this.storageInputContainerName; + } + + /** + * 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("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.writeStringField("storageInputContainerName", this.storageInputContainerName); + jsonWriter.writeBooleanField("multilingual", this.multilingual); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringProjectMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringProjectMetadata 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 AnalyzeConversationAuthoringProjectMetadata. + */ + @Generated + public static AnalyzeConversationAuthoringProjectMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime createdDateTime = null; + OffsetDateTime lastModifiedDateTime = null; + ProjectKind projectKind = null; + String projectName = null; + String language = null; + OffsetDateTime lastTrainedDateTime = null; + OffsetDateTime lastDeployedDateTime = null; + AnalyzeConversationAuthoringProjectSettings settings = null; + String storageInputContainerName = 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 ("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 = AnalyzeConversationAuthoringProjectSettings.fromJson(reader); + } else if ("storageInputContainerName".equals(fieldName)) { + storageInputContainerName = reader.getString(); + } else if ("multilingual".equals(fieldName)) { + multilingual = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringProjectMetadata deserializedAnalyzeConversationAuthoringProjectMetadata + = new AnalyzeConversationAuthoringProjectMetadata(createdDateTime, lastModifiedDateTime, projectKind, + language); + deserializedAnalyzeConversationAuthoringProjectMetadata.projectName = projectName; + deserializedAnalyzeConversationAuthoringProjectMetadata.lastTrainedDateTime = lastTrainedDateTime; + deserializedAnalyzeConversationAuthoringProjectMetadata.lastDeployedDateTime = lastDeployedDateTime; + deserializedAnalyzeConversationAuthoringProjectMetadata.settings = settings; + deserializedAnalyzeConversationAuthoringProjectMetadata.storageInputContainerName + = storageInputContainerName; + deserializedAnalyzeConversationAuthoringProjectMetadata.multilingual = multilingual; + deserializedAnalyzeConversationAuthoringProjectMetadata.description = description; + + return deserializedAnalyzeConversationAuthoringProjectMetadata; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectSettings.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectSettings.java new file mode 100644 index 000000000000..22202827bd72 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectSettings.java @@ -0,0 +1,148 @@ +// 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.conversations.authoring.models; + +import com.azure.ai.language.conversations.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 AnalyzeConversationAuthoringProjectSettings + implements JsonSerializable { + /* + * The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to + * "None". The value of the threshold should be between 0 and 1 inclusive. + */ + @Generated + private double confidenceThreshold; + + /** + * 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.setAnalyzeConversationAuthoringProjectSettingsAccessor( + new JsonMergePatchHelper.AnalyzeConversationAuthoringProjectSettingsAccessor() { + @Override + public AnalyzeConversationAuthoringProjectSettings prepareModelForJsonMergePatch( + AnalyzeConversationAuthoringProjectSettings model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(AnalyzeConversationAuthoringProjectSettings model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of AnalyzeConversationAuthoringProjectSettings class. + */ + @Generated + public AnalyzeConversationAuthoringProjectSettings() { + } + + /** + * Get the confidenceThreshold property: The threshold of the intent with the highest confidence, at which the + * prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 + * inclusive. + * + * @return the confidenceThreshold value. + */ + @Generated + public double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: The threshold of the intent with the highest confidence, at which the + * prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 + * inclusive. + *

Required when create the resource.

+ * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the AnalyzeConversationAuthoringProjectSettings object itself. + */ + @Generated + public AnalyzeConversationAuthoringProjectSettings setConfidenceThreshold(double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + this.updatedProperties.add("confidenceThreshold"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("confidenceThreshold", this.confidenceThreshold); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("confidenceThreshold")) { + jsonWriter.writeDoubleField("confidenceThreshold", this.confidenceThreshold); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringProjectSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringProjectSettings 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 AnalyzeConversationAuthoringProjectSettings. + */ + @Generated + public static AnalyzeConversationAuthoringProjectSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyzeConversationAuthoringProjectSettings deserializedAnalyzeConversationAuthoringProjectSettings + = new AnalyzeConversationAuthoringProjectSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confidenceThreshold".equals(fieldName)) { + deserializedAnalyzeConversationAuthoringProjectSettings.confidenceThreshold = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyzeConversationAuthoringProjectSettings; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectTrainedModel.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectTrainedModel.java new file mode 100644 index 000000000000..582aa42e21c0 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringProjectTrainedModel.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.conversations.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 AnalyzeConversationAuthoringProjectTrainedModel + 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 AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel(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 AnalyzeConversationAuthoringProjectTrainedModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringProjectTrainedModel 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 AnalyzeConversationAuthoringProjectTrainedModel. + */ + @Generated + public static AnalyzeConversationAuthoringProjectTrainedModel 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(); + } + } + AnalyzeConversationAuthoringProjectTrainedModel deserializedAnalyzeConversationAuthoringProjectTrainedModel + = new AnalyzeConversationAuthoringProjectTrainedModel(modelId, lastTrainedDateTime, + lastTrainingDurationInSeconds, modelExpirationDate, modelTrainingConfigVersion, hasSnapshot); + deserializedAnalyzeConversationAuthoringProjectTrainedModel.label = label; + + return deserializedAnalyzeConversationAuthoringProjectTrainedModel; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringResourceMetadata.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringResourceMetadata.java new file mode 100644 index 000000000000..66d1b0f7c890 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringResourceMetadata.java @@ -0,0 +1,128 @@ +// 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.conversations.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 AnalyzeConversationAuthoringResourceMetadata + 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 AnalyzeConversationAuthoringResourceMetadata class. + * + * @param azureResourceId the azureResourceId value to set. + * @param customDomain the customDomain value to set. + * @param region the region value to set. + */ + @Generated + public AnalyzeConversationAuthoringResourceMetadata(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 AnalyzeConversationAuthoringResourceMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringResourceMetadata 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 AnalyzeConversationAuthoringResourceMetadata. + */ + @Generated + public static AnalyzeConversationAuthoringResourceMetadata 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 AnalyzeConversationAuthoringResourceMetadata(azureResourceId, customDomain, region); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSubTrainingJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSubTrainingJobState.java new file mode 100644 index 000000000000..087d31de2613 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSubTrainingJobState.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.conversations.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 AnalyzeConversationAuthoringSubTrainingJobState + 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 AnalyzeConversationAuthoringSubTrainingJobState class. + * + * @param percentComplete the percentComplete value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringSubTrainingJobState(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 AnalyzeConversationAuthoringSubTrainingJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringSubTrainingJobState 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 AnalyzeConversationAuthoringSubTrainingJobState. + */ + @Generated + public static AnalyzeConversationAuthoringSubTrainingJobState 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(); + } + } + AnalyzeConversationAuthoringSubTrainingJobState deserializedAnalyzeConversationAuthoringSubTrainingJobState + = new AnalyzeConversationAuthoringSubTrainingJobState(percentComplete, status); + deserializedAnalyzeConversationAuthoringSubTrainingJobState.startDateTime = startDateTime; + deserializedAnalyzeConversationAuthoringSubTrainingJobState.endDateTime = endDateTime; + + return deserializedAnalyzeConversationAuthoringSubTrainingJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguage.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguage.java new file mode 100644 index 000000000000..5988331f1ed1 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguage.java @@ -0,0 +1,108 @@ +// 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.conversations.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 AnalyzeConversationAuthoringSupportedLanguage + implements JsonSerializable { + /* + * The language name. + */ + @Generated + private final 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 AnalyzeConversationAuthoringSupportedLanguage class. + * + * @param languageName the languageName value to set. + * @param languageCode the languageCode value to set. + */ + @Generated + private AnalyzeConversationAuthoringSupportedLanguage(String languageName, String languageCode) { + this.languageName = languageName; + 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("languageName", this.languageName); + jsonWriter.writeStringField("languageCode", this.languageCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringSupportedLanguage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringSupportedLanguage 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 AnalyzeConversationAuthoringSupportedLanguage. + */ + @Generated + public static AnalyzeConversationAuthoringSupportedLanguage 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(); + } + } + return new AnalyzeConversationAuthoringSupportedLanguage(languageName, languageCode); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguages.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguages.java new file mode 100644 index 000000000000..e1487bc16b16 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSupportedLanguages.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.conversations.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 a list of retrieved languages. + */ +@Immutable +public final class AnalyzeConversationAuthoringSupportedLanguages + implements JsonSerializable { + /* + * The list of the languages. + */ + @Generated + private final List value; + + /* + * The next page link. + */ + @Generated + private String nextLink; + + /** + * Creates an instance of AnalyzeConversationAuthoringSupportedLanguages class. + * + * @param value the value value to set. + */ + @Generated + private AnalyzeConversationAuthoringSupportedLanguages(List value) { + this.value = value; + } + + /** + * Get the value property: The list of the languages. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: The next page link. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringSupportedLanguages from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringSupportedLanguages 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 AnalyzeConversationAuthoringSupportedLanguages. + */ + @Generated + public static AnalyzeConversationAuthoringSupportedLanguages fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value + = reader.readArray(reader1 -> AnalyzeConversationAuthoringSupportedLanguage.fromJson(reader1)); + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringSupportedLanguages deserializedAnalyzeConversationAuthoringSupportedLanguages + = new AnalyzeConversationAuthoringSupportedLanguages(value); + deserializedAnalyzeConversationAuthoringSupportedLanguages.nextLink = nextLink; + + return deserializedAnalyzeConversationAuthoringSupportedLanguages; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsJobState.java new file mode 100644 index 000000000000..212228fde625 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsJobState.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.conversations.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 AnalyzeConversationAuthoringSwapDeploymentsJobState + 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 AnalyzeConversationAuthoringSwapDeploymentsJobState class. + * + * @param createdDateTime the createdDateTime value to set. + * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. + * @param status the status value to set. + */ + @Generated + private AnalyzeConversationAuthoringSwapDeploymentsJobState(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 AnalyzeConversationAuthoringSwapDeploymentsJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringSwapDeploymentsJobState 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 AnalyzeConversationAuthoringSwapDeploymentsJobState. + */ + @Generated + public static AnalyzeConversationAuthoringSwapDeploymentsJobState 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 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringSwapDeploymentsJobState deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState + = new AnalyzeConversationAuthoringSwapDeploymentsJobState(createdDateTime, lastUpdatedDateTime, status); + deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringSwapDeploymentsJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsOptions.java new file mode 100644 index 000000000000..f06b0a96c0a4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringSwapDeploymentsOptions.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.conversations.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 AnalyzeConversationAuthoringSwapDeploymentsOptions + 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 AnalyzeConversationAuthoringSwapDeploymentsOptions class. + * + * @param firstDeploymentName the firstDeploymentName value to set. + * @param secondDeploymentName the secondDeploymentName value to set. + */ + @Generated + public AnalyzeConversationAuthoringSwapDeploymentsOptions(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 AnalyzeConversationAuthoringSwapDeploymentsOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringSwapDeploymentsOptions 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 AnalyzeConversationAuthoringSwapDeploymentsOptions. + */ + @Generated + public static AnalyzeConversationAuthoringSwapDeploymentsOptions 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 AnalyzeConversationAuthoringSwapDeploymentsOptions(firstDeploymentName, secondDeploymentName); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersion.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersion.java new file mode 100644 index 000000000000..64279f17dd1f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersion.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.conversations.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 AnalyzeConversationAuthoringTrainingConfigVersion + implements JsonSerializable { + /* + * Represents the version of the config. + */ + @Generated + private final String trainingConfigVersion; + + /* + * Represents the training config version expiration date. + */ + @Generated + private final LocalDate modelExpirationDate; + + /** + * Creates an instance of AnalyzeConversationAuthoringTrainingConfigVersion class. + * + * @param trainingConfigVersion the trainingConfigVersion value to set. + * @param modelExpirationDate the modelExpirationDate value to set. + */ + @Generated + private AnalyzeConversationAuthoringTrainingConfigVersion(String trainingConfigVersion, + LocalDate modelExpirationDate) { + this.trainingConfigVersion = trainingConfigVersion; + 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("trainingConfigVersion", this.trainingConfigVersion); + jsonWriter.writeStringField("modelExpirationDate", Objects.toString(this.modelExpirationDate, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringTrainingConfigVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringTrainingConfigVersion 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 AnalyzeConversationAuthoringTrainingConfigVersion. + */ + @Generated + public static AnalyzeConversationAuthoringTrainingConfigVersion 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(); + } + } + return new AnalyzeConversationAuthoringTrainingConfigVersion(trainingConfigVersion, modelExpirationDate); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersions.java new file mode 100644 index 000000000000..925921bde08e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingConfigVersions.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.conversations.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 a list of training config versions. + */ +@Immutable +public final class AnalyzeConversationAuthoringTrainingConfigVersions + implements JsonSerializable { + /* + * The list of the training config versions. + */ + @Generated + private final List value; + + /* + * The next page link. + */ + @Generated + private String nextLink; + + /** + * Creates an instance of AnalyzeConversationAuthoringTrainingConfigVersions class. + * + * @param value the value value to set. + */ + @Generated + private AnalyzeConversationAuthoringTrainingConfigVersions( + List value) { + this.value = value; + } + + /** + * Get the value property: The list of the training config versions. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: The next page link. + * + * @return the nextLink value. + */ + @Generated + public String getNextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringTrainingConfigVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringTrainingConfigVersions 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 AnalyzeConversationAuthoringTrainingConfigVersions. + */ + @Generated + public static AnalyzeConversationAuthoringTrainingConfigVersions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader + .readArray(reader1 -> AnalyzeConversationAuthoringTrainingConfigVersion.fromJson(reader1)); + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringTrainingConfigVersions deserializedAnalyzeConversationAuthoringTrainingConfigVersions + = new AnalyzeConversationAuthoringTrainingConfigVersions(value); + deserializedAnalyzeConversationAuthoringTrainingConfigVersions.nextLink = nextLink; + + return deserializedAnalyzeConversationAuthoringTrainingConfigVersions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobOptions.java new file mode 100644 index 000000000000..c6620301a6ce --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobOptions.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.conversations.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 AnalyzeConversationAuthoringTrainingJobOptions + implements JsonSerializable { + /* + * Represents the output model label. + */ + @Generated + private final String modelLabel; + + /* + * Represents training config version. By default, "latest" value is used which uses the latest released training + * config version. + */ + @Generated + private String trainingConfigVersion; + + /* + * Represents the mode of the training operation. + */ + @Generated + private final TrainingMode trainingMode; + + /* + * 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 AnalyzeConversationAuthoringEvaluationOptions evaluationOptions; + + /** + * Creates an instance of AnalyzeConversationAuthoringTrainingJobOptions class. + * + * @param modelLabel the modelLabel value to set. + * @param trainingMode the trainingMode value to set. + */ + @Generated + public AnalyzeConversationAuthoringTrainingJobOptions(String modelLabel, TrainingMode trainingMode) { + this.modelLabel = modelLabel; + this.trainingMode = trainingMode; + } + + /** + * 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. By default, "latest" value is used + * which uses the latest released training config version. + * + * @return the trainingConfigVersion value. + */ + @Generated + public String getTrainingConfigVersion() { + return this.trainingConfigVersion; + } + + /** + * Set the trainingConfigVersion property: Represents training config version. By default, "latest" value is used + * which uses the latest released training config version. + * + * @param trainingConfigVersion the trainingConfigVersion value to set. + * @return the AnalyzeConversationAuthoringTrainingJobOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringTrainingJobOptions setTrainingConfigVersion(String trainingConfigVersion) { + this.trainingConfigVersion = trainingConfigVersion; + return this; + } + + /** + * Get the trainingMode property: Represents the mode of the training operation. + * + * @return the trainingMode value. + */ + @Generated + public TrainingMode getTrainingMode() { + return this.trainingMode; + } + + /** + * 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 AnalyzeConversationAuthoringEvaluationOptions 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 AnalyzeConversationAuthoringTrainingJobOptions object itself. + */ + @Generated + public AnalyzeConversationAuthoringTrainingJobOptions + setEvaluationOptions(AnalyzeConversationAuthoringEvaluationOptions evaluationOptions) { + this.evaluationOptions = evaluationOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelLabel", this.modelLabel); + jsonWriter.writeStringField("trainingMode", this.trainingMode == null ? null : this.trainingMode.toString()); + jsonWriter.writeStringField("trainingConfigVersion", this.trainingConfigVersion); + jsonWriter.writeJsonField("evaluationOptions", this.evaluationOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringTrainingJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringTrainingJobOptions 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 AnalyzeConversationAuthoringTrainingJobOptions. + */ + @Generated + public static AnalyzeConversationAuthoringTrainingJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelLabel = null; + TrainingMode trainingMode = null; + String trainingConfigVersion = null; + AnalyzeConversationAuthoringEvaluationOptions evaluationOptions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modelLabel".equals(fieldName)) { + modelLabel = reader.getString(); + } else if ("trainingMode".equals(fieldName)) { + trainingMode = TrainingMode.fromString(reader.getString()); + } else if ("trainingConfigVersion".equals(fieldName)) { + trainingConfigVersion = reader.getString(); + } else if ("evaluationOptions".equals(fieldName)) { + evaluationOptions = AnalyzeConversationAuthoringEvaluationOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringTrainingJobOptions deserializedAnalyzeConversationAuthoringTrainingJobOptions + = new AnalyzeConversationAuthoringTrainingJobOptions(modelLabel, trainingMode); + deserializedAnalyzeConversationAuthoringTrainingJobOptions.trainingConfigVersion = trainingConfigVersion; + deserializedAnalyzeConversationAuthoringTrainingJobOptions.evaluationOptions = evaluationOptions; + + return deserializedAnalyzeConversationAuthoringTrainingJobOptions; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobResult.java new file mode 100644 index 000000000000..5f7df34ecf98 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobResult.java @@ -0,0 +1,202 @@ +// 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.conversations.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 AnalyzeConversationAuthoringTrainingJobResult + implements JsonSerializable { + /* + * Represents trained model label. + */ + @Generated + private final String modelLabel; + + /* + * Represents training config version. + */ + @Generated + private final String trainingConfigVersion; + + /* + * Represents the mode of the training operation. + */ + @Generated + private TrainingMode trainingMode; + + /* + * Represents the model training status. + */ + @Generated + private final AnalyzeConversationAuthoringSubTrainingJobState trainingStatus; + + /* + * Represents model evaluation status. + */ + @Generated + private AnalyzeConversationAuthoringSubTrainingJobState evaluationStatus; + + /* + * Represents the estimated end date time for training and evaluation. + */ + @Generated + private OffsetDateTime estimatedEndDateTime; + + /** + * Creates an instance of AnalyzeConversationAuthoringTrainingJobResult class. + * + * @param modelLabel the modelLabel value to set. + * @param trainingConfigVersion the trainingConfigVersion value to set. + * @param trainingStatus the trainingStatus value to set. + */ + @Generated + private AnalyzeConversationAuthoringTrainingJobResult(String modelLabel, String trainingConfigVersion, + AnalyzeConversationAuthoringSubTrainingJobState 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 trainingMode property: Represents the mode of the training operation. + * + * @return the trainingMode value. + */ + @Generated + public TrainingMode getTrainingMode() { + return this.trainingMode; + } + + /** + * Get the trainingStatus property: Represents the model training status. + * + * @return the trainingStatus value. + */ + @Generated + public AnalyzeConversationAuthoringSubTrainingJobState getTrainingStatus() { + return this.trainingStatus; + } + + /** + * Get the evaluationStatus property: Represents model evaluation status. + * + * @return the evaluationStatus value. + */ + @Generated + public AnalyzeConversationAuthoringSubTrainingJobState getEvaluationStatus() { + return this.evaluationStatus; + } + + /** + * Get the estimatedEndDateTime property: Represents the estimated 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.writeStringField("trainingMode", this.trainingMode == null ? null : this.trainingMode.toString()); + 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 AnalyzeConversationAuthoringTrainingJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringTrainingJobResult 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 AnalyzeConversationAuthoringTrainingJobResult. + */ + @Generated + public static AnalyzeConversationAuthoringTrainingJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelLabel = null; + String trainingConfigVersion = null; + AnalyzeConversationAuthoringSubTrainingJobState trainingStatus = null; + TrainingMode trainingMode = null; + AnalyzeConversationAuthoringSubTrainingJobState 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 = AnalyzeConversationAuthoringSubTrainingJobState.fromJson(reader); + } else if ("trainingMode".equals(fieldName)) { + trainingMode = TrainingMode.fromString(reader.getString()); + } else if ("evaluationStatus".equals(fieldName)) { + evaluationStatus = AnalyzeConversationAuthoringSubTrainingJobState.fromJson(reader); + } else if ("estimatedEndDateTime".equals(fieldName)) { + estimatedEndDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringTrainingJobResult deserializedAnalyzeConversationAuthoringTrainingJobResult + = new AnalyzeConversationAuthoringTrainingJobResult(modelLabel, trainingConfigVersion, trainingStatus); + deserializedAnalyzeConversationAuthoringTrainingJobResult.trainingMode = trainingMode; + deserializedAnalyzeConversationAuthoringTrainingJobResult.evaluationStatus = evaluationStatus; + deserializedAnalyzeConversationAuthoringTrainingJobResult.estimatedEndDateTime = estimatedEndDateTime; + + return deserializedAnalyzeConversationAuthoringTrainingJobResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobState.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobState.java new file mode 100644 index 000000000000..0fce3536e5c5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringTrainingJobState.java @@ -0,0 +1,252 @@ +// 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.conversations.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 AnalyzeConversationAuthoringTrainingJobState + 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 AnalyzeConversationAuthoringTrainingJobResult result; + + /** + * Creates an instance of AnalyzeConversationAuthoringTrainingJobState 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 AnalyzeConversationAuthoringTrainingJobState(OffsetDateTime createdDateTime, + OffsetDateTime lastUpdatedDateTime, JobStatus status, AnalyzeConversationAuthoringTrainingJobResult 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 AnalyzeConversationAuthoringTrainingJobResult 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 AnalyzeConversationAuthoringTrainingJobState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringTrainingJobState 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 AnalyzeConversationAuthoringTrainingJobState. + */ + @Generated + public static AnalyzeConversationAuthoringTrainingJobState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String jobId = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastUpdatedDateTime = null; + JobStatus status = null; + AnalyzeConversationAuthoringTrainingJobResult 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 = AnalyzeConversationAuthoringTrainingJobResult.fromJson(reader); + } else if ("expirationDateTime".equals(fieldName)) { + expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> Warning.fromJson(reader1)); + } else if ("errors".equals(fieldName)) { + errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringTrainingJobState deserializedAnalyzeConversationAuthoringTrainingJobState + = new AnalyzeConversationAuthoringTrainingJobState(createdDateTime, lastUpdatedDateTime, status, + result); + deserializedAnalyzeConversationAuthoringTrainingJobState.jobId = jobId; + deserializedAnalyzeConversationAuthoringTrainingJobState.expirationDateTime = expirationDateTime; + deserializedAnalyzeConversationAuthoringTrainingJobState.warnings = warnings; + deserializedAnalyzeConversationAuthoringTrainingJobState.errors = errors; + + return deserializedAnalyzeConversationAuthoringTrainingJobState; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions.java new file mode 100644 index 000000000000..3ab686e1bcd2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions.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.conversations.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 AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions + implements JsonSerializable { + /* + * Represents the assigned resource IDs to be unassigned. + */ + @Generated + private final List assignedResourceIds; + + /** + * Creates an instance of AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions class. + * + * @param assignedResourceIds the assignedResourceIds value to set. + */ + @Generated + public AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions(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 AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions 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 + * AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions. + */ + @Generated + public static AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions 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 AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions(assignedResourceIds); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult.java new file mode 100644 index 000000000000..ef6c294564ea --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult.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.conversations.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 entities for an utterance. + */ +@Immutable +public final class AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult + implements JsonSerializable { + /* + * Represents the expected entity labels. + */ + @Generated + private final List expectedEntities; + + /* + * Represents the predicted entity labels. + */ + @Generated + private final List predictedEntities; + + /** + * Creates an instance of AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult class. + * + * @param expectedEntities the expectedEntities value to set. + * @param predictedEntities the predictedEntities value to set. + */ + @Generated + private AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult( + List expectedEntities, + List predictedEntities) { + this.expectedEntities = expectedEntities; + this.predictedEntities = predictedEntities; + } + + /** + * Get the expectedEntities property: Represents the expected entity labels. + * + * @return the expectedEntities value. + */ + @Generated + public List getExpectedEntities() { + return this.expectedEntities; + } + + /** + * Get the predictedEntities property: Represents the predicted entity labels. + * + * @return the predictedEntities value. + */ + @Generated + public List getPredictedEntities() { + return this.predictedEntities; + } + + /** + * {@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)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult 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 + * AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult. + */ + @Generated + public static AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + List expectedEntities = null; + List predictedEntities = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedEntities".equals(fieldName)) { + expectedEntities = reader.readArray( + reader1 -> AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.fromJson(reader1)); + } else if ("predictedEntities".equals(fieldName)) { + predictedEntities = reader.readArray( + reader1 -> AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult(expectedEntities, + predictedEntities); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.java new file mode 100644 index 000000000000..05c34a407675 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEntityEvaluationResult.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.conversations.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 output of an entity label or prediction. + */ +@Immutable +public final class AnalyzeConversationAuthoringUtteranceEntityEvaluationResult + 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 AnalyzeConversationAuthoringUtteranceEntityEvaluationResult class. + * + * @param category the category value to set. + * @param offset the offset value to set. + * @param length the length value to set. + */ + @Generated + private AnalyzeConversationAuthoringUtteranceEntityEvaluationResult(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 AnalyzeConversationAuthoringUtteranceEntityEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringUtteranceEntityEvaluationResult 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 + * AnalyzeConversationAuthoringUtteranceEntityEvaluationResult. + */ + @Generated + public static AnalyzeConversationAuthoringUtteranceEntityEvaluationResult 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 AnalyzeConversationAuthoringUtteranceEntityEvaluationResult(category, offset, length); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEvaluationResult.java new file mode 100644 index 000000000000..4d0da2a66b3e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceEvaluationResult.java @@ -0,0 +1,156 @@ +// 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.conversations.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 for an utterance. + */ +@Immutable +public final class AnalyzeConversationAuthoringUtteranceEvaluationResult + implements JsonSerializable { + /* + * Represents the utterance text. + */ + @Generated + private String text; + + /* + * Represents the utterance 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; + + /* + * Represents the entities results for the utterance. + */ + @Generated + private final AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult entitiesResult; + + /* + * Represents the intents results for the utterance. + */ + @Generated + private final AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult intentsResult; + + /** + * Creates an instance of AnalyzeConversationAuthoringUtteranceEvaluationResult class. + * + * @param language the language value to set. + * @param entitiesResult the entitiesResult value to set. + * @param intentsResult the intentsResult value to set. + */ + @Generated + private AnalyzeConversationAuthoringUtteranceEvaluationResult(String language, + AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult entitiesResult, + AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult intentsResult) { + this.language = language; + this.entitiesResult = entitiesResult; + this.intentsResult = intentsResult; + } + + /** + * Get the text property: Represents the utterance text. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Get the language property: Represents the utterance 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; + } + + /** + * Get the entitiesResult property: Represents the entities results for the utterance. + * + * @return the entitiesResult value. + */ + @Generated + public AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult getEntitiesResult() { + return this.entitiesResult; + } + + /** + * Get the intentsResult property: Represents the intents results for the utterance. + * + * @return the intentsResult value. + */ + @Generated + public AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult getIntentsResult() { + return this.intentsResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeJsonField("entitiesResult", this.entitiesResult); + jsonWriter.writeJsonField("intentsResult", this.intentsResult); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringUtteranceEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringUtteranceEvaluationResult 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 AnalyzeConversationAuthoringUtteranceEvaluationResult. + */ + @Generated + public static AnalyzeConversationAuthoringUtteranceEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + String language = null; + AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult entitiesResult = null; + AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult intentsResult = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("entitiesResult".equals(fieldName)) { + entitiesResult = AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult.fromJson(reader); + } else if ("intentsResult".equals(fieldName)) { + intentsResult = AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AnalyzeConversationAuthoringUtteranceEvaluationResult deserializedAnalyzeConversationAuthoringUtteranceEvaluationResult + = new AnalyzeConversationAuthoringUtteranceEvaluationResult(language, entitiesResult, intentsResult); + deserializedAnalyzeConversationAuthoringUtteranceEvaluationResult.text = text; + + return deserializedAnalyzeConversationAuthoringUtteranceEvaluationResult; + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult.java new file mode 100644 index 000000000000..b1eeceec1185 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult.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.conversations.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 the predicted intent for an utterance. + */ +@Immutable +public final class AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult + implements JsonSerializable { + /* + * Represents the utterance's expected intent. + */ + @Generated + private final String expectedIntent; + + /* + * Represents the utterance's predicted intent. + */ + @Generated + private final String predictedIntent; + + /** + * Creates an instance of AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult class. + * + * @param expectedIntent the expectedIntent value to set. + * @param predictedIntent the predictedIntent value to set. + */ + @Generated + private AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult(String expectedIntent, + String predictedIntent) { + this.expectedIntent = expectedIntent; + this.predictedIntent = predictedIntent; + } + + /** + * Get the expectedIntent property: Represents the utterance's expected intent. + * + * @return the expectedIntent value. + */ + @Generated + public String getExpectedIntent() { + return this.expectedIntent; + } + + /** + * Get the predictedIntent property: Represents the utterance's predicted intent. + * + * @return the predictedIntent value. + */ + @Generated + public String getPredictedIntent() { + return this.predictedIntent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expectedIntent", this.expectedIntent); + jsonWriter.writeStringField("predictedIntent", this.predictedIntent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult 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 + * AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult. + */ + @Generated + public static AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String expectedIntent = null; + String predictedIntent = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expectedIntent".equals(fieldName)) { + expectedIntent = reader.getString(); + } else if ("predictedIntent".equals(fieldName)) { + predictedIntent = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult(expectedIntent, predictedIntent); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/CompositionSetting.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/CompositionSetting.java new file mode 100644 index 000000000000..0091a17b1e8e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/CompositionSetting.java @@ -0,0 +1,72 @@ +// 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.conversations.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 { + /** + * When two or more components are found in the text and overlap, the component with the longest set of characters + * is returned. + */ + @Generated + public static final CompositionSetting RETURN_LONGEST_OVERLAP = fromString("returnLongestOverlap"); + + /** + * All components must overlap at the exact same characters in the text for the entity to return. If one of the + * defined components is not matched or predicted, the entity will not return. + */ + @Generated + public static final CompositionSetting REQUIRE_EXACT_OVERLAP = fromString("requireExactOverlap"); + + /** + * 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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Error.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Error.java new file mode 100644 index 000000000000..22fd3ae716cd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Error.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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ErrorCode.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ErrorCode.java new file mode 100644 index 000000000000..f2134578b67e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/EvaluationKind.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/EvaluationKind.java new file mode 100644 index 000000000000..ffe244e6dc74 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedModelOptions.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedModelOptions.java new file mode 100644 index 000000000000..43928828d855 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedModelOptions.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.conversations.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 ExportedModelOptions implements JsonSerializable { + /* + * The trained model label. + */ + @Generated + private final String trainedModelLabel; + + /** + * Creates an instance of ExportedModelOptions class. + * + * @param trainedModelLabel the trainedModelLabel value to set. + */ + @Generated + public ExportedModelOptions(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 ExportedModelOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportedModelOptions 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 ExportedModelOptions. + */ + @Generated + public static ExportedModelOptions 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 ExportedModelOptions(trainedModelLabel); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedProjectFormat.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedProjectFormat.java new file mode 100644 index 000000000000..be793385ecdd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ExportedProjectFormat.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.conversations.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ExportedProjectFormat. + */ +public final class ExportedProjectFormat extends ExpandableStringEnum { + /** + * Specifies the format for a conversational project. + */ + @Generated + public static final ExportedProjectFormat CONVERSATION = fromString("Conversation"); + + /** + * Specifies the format for an application that was exported from LUIS. + */ + @Generated + public static final ExportedProjectFormat LUIS = fromString("Luis"); + + /** + * Creates a new instance of ExportedProjectFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ExportedProjectFormat() { + } + + /** + * Creates or finds a ExportedProjectFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportedProjectFormat. + */ + @Generated + public static ExportedProjectFormat fromString(String name) { + return fromString(name, ExportedProjectFormat.class); + } + + /** + * Gets known ExportedProjectFormat values. + * + * @return known ExportedProjectFormat values. + */ + @Generated + public static Collection values() { + return values(ExportedProjectFormat.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorCode.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorCode.java new file mode 100644 index 000000000000..e7955f56be64 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorModel.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/InnerErrorModel.java new file mode 100644 index 000000000000..22b34942389d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/JobStatus.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/JobStatus.java new file mode 100644 index 000000000000..fcd6d4dceeda --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/OrchestrationTargetProjectKind.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/OrchestrationTargetProjectKind.java new file mode 100644 index 000000000000..b03ab6364e8e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/OrchestrationTargetProjectKind.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.conversations.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for OrchestrationTargetProjectKind. + */ +public final class OrchestrationTargetProjectKind extends ExpandableStringEnum { + /** + * Static value Luis for OrchestrationTargetProjectKind. + */ + @Generated + public static final OrchestrationTargetProjectKind LUIS = fromString("Luis"); + + /** + * Static value Conversation for OrchestrationTargetProjectKind. + */ + @Generated + public static final OrchestrationTargetProjectKind CONVERSATION = fromString("Conversation"); + + /** + * Static value QuestionAnswering for OrchestrationTargetProjectKind. + */ + @Generated + public static final OrchestrationTargetProjectKind QUESTION_ANSWERING = fromString("QuestionAnswering"); + + /** + * Creates a new instance of OrchestrationTargetProjectKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OrchestrationTargetProjectKind() { + } + + /** + * Creates or finds a OrchestrationTargetProjectKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrchestrationTargetProjectKind. + */ + @Generated + public static OrchestrationTargetProjectKind fromString(String name) { + return fromString(name, OrchestrationTargetProjectKind.class); + } + + /** + * Gets known OrchestrationTargetProjectKind values. + * + * @return known OrchestrationTargetProjectKind values. + */ + @Generated + public static Collection values() { + return values(OrchestrationTargetProjectKind.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ProjectKind.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ProjectKind.java new file mode 100644 index 000000000000..0d80c896efde --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/ProjectKind.java @@ -0,0 +1,64 @@ +// 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.conversations.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 { + /** + * A project to build natural language into apps, bots, and IoT devices. + */ + @Generated + public static final ProjectKind CONVERSATION = fromString("Conversation"); + + /** + * A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one + * single project. + */ + @Generated + public static final ProjectKind ORCHESTRATION = fromString("Orchestration"); + + /** + * A project to build conversation summarization models which are able to summarize long conversations. + */ + @Generated + public static final ProjectKind CUSTOM_CONVERSATION_SUMMARIZATION = fromString("CustomConversationSummarization"); + + /** + * 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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/StringIndexType.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/StringIndexType.java new file mode 100644 index 000000000000..b82d9f5620e4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.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-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/TrainingMode.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/TrainingMode.java new file mode 100644 index 000000000000..2d5389291145 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/TrainingMode.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.conversations.authoring.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for TrainingMode. + */ +public final class TrainingMode extends ExpandableStringEnum { + /** + * Trains using fine-tuned neural network transformer models. Can train multilingual projects. + */ + @Generated + public static final TrainingMode ADVANCED = fromString("advanced"); + + /** + * Faster training times for quicker iterations. + */ + @Generated + public static final TrainingMode STANDARD = fromString("standard"); + + /** + * Creates a new instance of TrainingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TrainingMode() { + } + + /** + * Creates or finds a TrainingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrainingMode. + */ + @Generated + public static TrainingMode fromString(String name) { + return fromString(name, TrainingMode.class); + } + + /** + * Gets known TrainingMode values. + * + * @return known TrainingMode values. + */ + @Generated + public static Collection values() { + return values(TrainingMode.class); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Warning.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Warning.java new file mode 100644 index 000000000000..47cbebac5b6e --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/Warning.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.conversations.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 Warning implements JsonSerializable { + /* + * The warning code. + */ + @Generated + private final String code; + + /* + * The warning message. + */ + @Generated + private final String message; + + /** + * Creates an instance of Warning class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private Warning(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 Warning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Warning 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 Warning. + */ + @Generated + public static Warning 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 Warning(code, message); + }); + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/package-info.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/models/package-info.java new file mode 100644 index 000000000000..0a3ef4a10a40 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring.models; diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/package-info.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/authoring/package-info.java new file mode 100644 index 000000000000..99d0dfee8084 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/com/azure/ai/language/conversations/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.conversations.authoring; diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/module-info.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/java/module-info.java new file mode 100644 index 000000000000..05bc6964d8be --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-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.conversations.authoring { + requires transitive com.azure.core; + + exports com.azure.ai.language.conversations.authoring; + exports com.azure.ai.language.conversations.authoring.models; + + opens com.azure.ai.language.conversations.authoring.models to com.azure.core; + opens com.azure.ai.language.conversations.authoring.implementation.models to com.azure.core; +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/META-INF/azure-ai-language-conversations-authoring_apiview_properties.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/META-INF/azure-ai-language-conversations-authoring_apiview_properties.json new file mode 100644 index 000000000000..e4af2441f8ec --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/META-INF/azure-ai-language-conversations-authoring_apiview_properties.json @@ -0,0 +1,277 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient": "Language.Conversations.Authoring.AnalyzeConversationAuthoring", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginAssignDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.assignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginAssignDeploymentResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.assignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCancelTrainingJob": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.cancelTrainingJob", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCancelTrainingJobWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.cancelTrainingJob", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCopyProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCopyProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCreateOrUpdateExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginCreateOrUpdateExportedModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteDeploymentFromResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteDeploymentFromResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteDeploymentWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteExportedModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeleteProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeployProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deployProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginDeployProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deployProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginEvaluateModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.evaluateModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginEvaluateModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.evaluateModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginExport": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.export", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginExportWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.export", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginImportMethod": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.import", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginImportMethodWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.import", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginLoadSnapshot": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.loadSnapshot", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginLoadSnapshotWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.loadSnapshot", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginSwapDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.swapDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginSwapDeploymentsWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.swapDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginTrain": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.train", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginTrainWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.train", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginUnassignDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.unassignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.beginUnassignDeploymentResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.unassignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.copyProjectAuthorization": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProjectAuthorization", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.copyProjectAuthorizationWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProjectAuthorization", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.createProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.createProjectWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.deleteTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.deleteTrainedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getAssignDeploymentResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getAssignDeploymentResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getCopyProjectStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getCopyProjectStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getCopyProjectStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getCopyProjectStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeploymentDeleteFromResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeploymentDeleteFromResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeploymentStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeploymentStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getDeploymentWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getEvaluationStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getEvaluationStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getEvaluationStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getEvaluationStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportedModelJobStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportedModelJobStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getExportedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getImportStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getImportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getImportStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getImportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getLoadSnapshotStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getLoadSnapshotStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getModelEvaluationResults": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationResults", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getModelEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getModelEvaluationSummaryWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getProjectDeletionStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getProjectDeletionStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getProjectWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProject", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSupportedLanguages": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedLanguages", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSupportedLanguagesWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedLanguages", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSupportedPrebuiltEntities": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSupportedPrebuiltEntitiesWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSwapDeploymentsStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getSwapDeploymentsStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getTrainedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getTrainingStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainingStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getTrainingStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainingStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getUnassignDeploymentResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.getUnassignDeploymentResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listAssignedResourceDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listAssignedResourceDeploymentsWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listExportedModels": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listExportedModels", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listProjects": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listProjects", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listTrainedModels": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainedModels", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listTrainingConfigVersions": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listTrainingConfigVersionsWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.conversations.authoring.AuthoringAsyncClient.listTrainingJobs": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingJobs", + "com.azure.ai.language.conversations.authoring.AuthoringClient": "Language.Conversations.Authoring.AnalyzeConversationAuthoring", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginAssignDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.assignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginAssignDeploymentResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.assignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCancelTrainingJob": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.cancelTrainingJob", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCancelTrainingJobWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.cancelTrainingJob", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCopyProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCopyProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCreateOrUpdateExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginCreateOrUpdateExportedModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createOrUpdateExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteDeploymentFromResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteDeploymentFromResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeploymentFromResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteDeploymentWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteExportedModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeleteProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeployProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deployProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginDeployProjectWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deployProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginEvaluateModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.evaluateModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginEvaluateModelWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.evaluateModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginExport": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.export", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginExportWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.export", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginImportMethod": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.import", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginImportMethodWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.import", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginLoadSnapshot": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.loadSnapshot", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginLoadSnapshotWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.loadSnapshot", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginSwapDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.swapDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginSwapDeploymentsWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.swapDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginTrain": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.train", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginTrainWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.train", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginUnassignDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.unassignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.beginUnassignDeploymentResourcesWithModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.unassignDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.copyProjectAuthorization": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProjectAuthorization", + "com.azure.ai.language.conversations.authoring.AuthoringClient.copyProjectAuthorizationWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.copyProjectAuthorization", + "com.azure.ai.language.conversations.authoring.AuthoringClient.createProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.createProjectWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.createProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.deleteTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.deleteTrainedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.deleteTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getAssignDeploymentResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getAssignDeploymentResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getAssignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getCopyProjectStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getCopyProjectStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getCopyProjectStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getCopyProjectStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeploymentDeleteFromResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeploymentDeleteFromResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentDeleteFromResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeploymentStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeploymentStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeploymentStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getDeploymentWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getDeployment", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getEvaluationStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getEvaluationStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getEvaluationStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getEvaluationStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportedModelJobStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportedModelJobStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModelJobStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getExportedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getExportedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getImportStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getImportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getImportStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getImportStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getLoadSnapshotStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getLoadSnapshotStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getLoadSnapshotStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getModelEvaluationResults": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationResults", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getModelEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getModelEvaluationSummaryWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getModelEvaluationSummary", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getProjectDeletionStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getProjectDeletionStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProjectDeletionStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getProjectWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getProject", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSupportedLanguages": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedLanguages", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSupportedLanguagesWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedLanguages", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSupportedPrebuiltEntities": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSupportedPrebuiltEntitiesWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSupportedPrebuiltEntities", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSwapDeploymentsStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getSwapDeploymentsStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getSwapDeploymentsStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getTrainedModelWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainedModel", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getTrainingStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainingStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getTrainingStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getTrainingStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getUnassignDeploymentResourcesStatus": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.getUnassignDeploymentResourcesStatusWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.getUnassignDeploymentResourcesStatus", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listAssignedResourceDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listAssignedResourceDeploymentsWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listAssignedResourceDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listDeploymentResources": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listDeploymentResources", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listDeployments": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listDeployments", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listExportedModels": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listExportedModels", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listProjects": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listProjects", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listTrainedModels": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainedModels", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listTrainingConfigVersions": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listTrainingConfigVersionsWithResponse": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingConfigVersions", + "com.azure.ai.language.conversations.authoring.AuthoringClient.listTrainingJobs": "Language.Conversations.Authoring.AnalyzeConversationAuthoring.listTrainingJobs", + "com.azure.ai.language.conversations.authoring.AuthoringClientBuilder": "Language.Conversations.Authoring", + "com.azure.ai.language.conversations.authoring.implementation.models.CopyProjectAuthorizationRequest": "Language.Conversations.Authoring.copyProjectAuthorization.Request.anonymous", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignDeploymentResourcesOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignDeploymentResourcesOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedDeploymentResource", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedResourceDeploymentsMetadata", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConfusionMatrix": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrix", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConfusionMatrixCell": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixCell", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConfusionMatrixRow": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixRow", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConversationExportedEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedEntity", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConversationExportedIntent": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedIntent", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConversationExportedProjectAssets": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedProjectAssets", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringConversationExportedUtterance": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedUtterance", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCopyProjectJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCopyProjectOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCopyProjectOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateDeploymentOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCreateDeploymentOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringCreateProjectOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCreateProjectOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeleteDeploymentOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeleteDeploymentOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResource", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringDeploymentResourcesJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResourcesJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEntitiesEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntitiesEvaluationSummary", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEntityEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntityEvaluationSummary", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationJobResult", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationSummary", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportProjectJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportProjectJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedConversationOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedConversationOrchestration", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedConversationOrchestrationOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedConversationOrchestrationOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedEntityList": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityList", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedEntityListSynonym": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityListSynonym", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedEntityRegex": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityRegex", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedEntityRegexExpression": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityRegexExpression", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedEntitySublist": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntitySublist", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedLuisOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedLuisOrchestration", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedLuisOrchestrationOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedLuisOrchestrationOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedModelJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedModelJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedOrchestrationOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedOrchestrationOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedPrebuiltEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedPrebuiltEntity", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedProject", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedProjectAssets": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedProjectAssets", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedTrainedModel", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringExportedUtteranceEntityLabel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedUtteranceEntityLabel", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringImportProjectJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringImportProjectJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringIntentEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringIntentEvaluationSummary", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringIntentsEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringIntentsEvaluationSummary", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringLoadSnapshotJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringLoadSnapshotJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringOrchestrationExportedIntent": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedIntent", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringOrchestrationExportedProjectAssets": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedProjectAssets", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringOrchestrationExportedUtterance": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedUtterance", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringPrebuiltEntities": "Language.Conversations.Authoring.AnalyzeConversationAuthoringPrebuiltEntities", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringPrebuiltEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringPrebuiltEntity", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeletionJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectDeletionJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectDeployment", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectMetadata", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectSettings": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectSettings", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringProjectTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectTrainedModel", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringResourceMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringResourceMetadata", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSubTrainingJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSubTrainingJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSupportedLanguage": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSupportedLanguage", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSupportedLanguages": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSupportedLanguages", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSwapDeploymentsJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringSwapDeploymentsOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSwapDeploymentsOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingConfigVersion": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingConfigVersion", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingConfigVersions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingConfigVersions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobResult", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringTrainingJobState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobState", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUnassignDeploymentResourcesOptions", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceEntityEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceEntityEvaluationResult", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceEvaluationResult", + "com.azure.ai.language.conversations.authoring.models.AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult", + "com.azure.ai.language.conversations.authoring.models.CompositionSetting": "Language.Conversations.Authoring.CompositionSetting", + "com.azure.ai.language.conversations.authoring.models.Error": "Language.Conversations.Authoring.Error", + "com.azure.ai.language.conversations.authoring.models.ErrorCode": "Language.Conversations.Authoring.ErrorCode", + "com.azure.ai.language.conversations.authoring.models.EvaluationKind": "Language.Conversations.Authoring.EvaluationKind", + "com.azure.ai.language.conversations.authoring.models.ExportedModelOptions": "Language.Conversations.Authoring.ExportedModelOptions", + "com.azure.ai.language.conversations.authoring.models.ExportedProjectFormat": "Language.Conversations.Authoring.ExportedProjectFormat", + "com.azure.ai.language.conversations.authoring.models.InnerErrorCode": "Language.Conversations.Authoring.InnerErrorCode", + "com.azure.ai.language.conversations.authoring.models.InnerErrorModel": "Language.Conversations.Authoring.InnerErrorModel", + "com.azure.ai.language.conversations.authoring.models.JobStatus": "Language.Conversations.Authoring.JobStatus", + "com.azure.ai.language.conversations.authoring.models.OrchestrationTargetProjectKind": "Language.Conversations.Authoring.OrchestrationTargetProjectKind", + "com.azure.ai.language.conversations.authoring.models.ProjectKind": "Language.Conversations.Authoring.ProjectKind", + "com.azure.ai.language.conversations.authoring.models.StringIndexType": "Language.Conversations.Authoring.StringIndexType", + "com.azure.ai.language.conversations.authoring.models.TrainingMode": "Language.Conversations.Authoring.TrainingMode", + "com.azure.ai.language.conversations.authoring.models.Warning": "Language.Conversations.Authoring.Warning" + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/azure-ai-language-conversations-authoring.properties b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/azure-ai-language-conversations-authoring.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/main/resources/azure-ai-language-conversations-authoring.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/samples/java/com/azure/ai/language/conversations/authoring/ReadmeSamples.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/samples/java/com/azure/ai/language/conversations/authoring/ReadmeSamples.java new file mode 100644 index 000000000000..236b32e93b84 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/samples/java/com/azure/ai/language/conversations/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.conversations.authoring; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.ai.language.conversations.authoring.readme + // END: com.azure.ai.language.conversations.authoring.readme + } +} diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/test/java/com/azure/ai/language/conversations/authoring/generated/AuthoringClientTestBase.java b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/test/java/com/azure/ai/language/conversations/authoring/generated/AuthoringClientTestBase.java new file mode 100644 index 000000000000..fd1624c60bf5 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/src/test/java/com/azure/ai/language/conversations/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.conversations.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.conversations.authoring.AuthoringClient; +import com.azure.ai.language.conversations.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-conversations-authoring/tsp-location.yaml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml new file mode 100644 index 000000000000..23c2de0edbf4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeConversations-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..af7b04086aa1 --- /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-conversations-authoring/ + exclude: + - sdk/cognitivelanguage/pom.xml + - sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitivelanguage/ci.yml + - sdk/cognitivelanguage/azure-ai-language-conversations-authoring/ + exclude: + - sdk/cognitivelanguage/pom.xml + - sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pom.xml + +parameters: + - name: release_azureailanguageconversationsauthoring + displayName: azure-ai-language-conversations-authoring + type: boolean + default: true + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: cognitivelanguage + Artifacts: + - name: azure-ai-language-conversations-authoring + groupId: com.azure + safeName: azureailanguageconversationsauthoring + releaseInBatch: ${{ parameters.release_azureailanguageconversationsauthoring }} diff --git a/sdk/cognitivelanguage/pom.xml b/sdk/cognitivelanguage/pom.xml new file mode 100644 index 000000000000..8ed486c41aa4 --- /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-conversations-authoring + +