diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md index 696965b3582a..f457f90f3753 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0b3 (2025-12-08) + +skip changelog generation for data-plane package and please add changelog manually. + ## 1.0.0b2 (2025-11-14) ### Features Added diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json index 509044270b48..06ad239bda74 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json @@ -1,3 +1,7 @@ { - "apiVersion": "2025-11-15-preview" + "apiVersion": "2025-11-15-preview", + "commit": "2fc7fcc9a50bcea5b3dd9307b80f09c440e385bb", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring", + "emitterVersion": "0.54.0" } \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json index 18f8563ccea2..d5e8477103ba 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json @@ -1,74 +1,27 @@ { "CrossLanguagePackageId": "Language.Conversations.Authoring", "CrossLanguageDefinitionId": { + "azure.ai.language.conversations.authoring.models.AssignedDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceInfo", "azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentMetadata", "azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentsMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedProjectDeploymentsMetadata", - "azure.ai.language.conversations.authoring.models.AssignedProjectResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceInfo", - "azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceAssignments", "azure.ai.language.conversations.authoring.models.ConfusionMatrixCell": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixCell", "azure.ai.language.conversations.authoring.models.ConfusionMatrixRow": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixRow", - "azure.ai.language.conversations.authoring.models.ConversationExportedAssociatedEntityLabel": "Language.Conversations.Authoring.AnalyzeConversationExportedAssociatedEntityLabel", - "azure.ai.language.conversations.authoring.models.ConversationExportedEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedEntity", - "azure.ai.language.conversations.authoring.models.ConversationExportedIntent": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedIntent", - "azure.ai.language.conversations.authoring.models.ExportedProjectAsset": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedProjectAssets", - "azure.ai.language.conversations.authoring.models.ConversationExportedProjectAsset": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedProjectAsset", - "azure.ai.language.conversations.authoring.models.ConversationExportedUtterance": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConversationExportedUtterance", - "azure.ai.language.conversations.authoring.models.CopyProjectDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCopiedProjectOptions", - "azure.ai.language.conversations.authoring.models.CopyProjectState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCopiedProjectJobState", - "azure.ai.language.conversations.authoring.models.CreateDeploymentDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCreateDeploymentOptions", "azure.ai.language.conversations.authoring.models.CreateProjectOptions": "Language.Conversations.Authoring.AnalyzeConversationAuthoringCreateProjectOptions", - "azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationConnectionInfo", - "azure.ai.language.conversations.authoring.models.DataGenerationSettings": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationSettings", - "azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState", - "azure.ai.language.conversations.authoring.models.DeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResource", - "azure.ai.language.conversations.authoring.models.DeploymentState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentJobState", "azure.ai.language.conversations.authoring.models.EntitiesEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntitiesEvaluationSummary", "azure.ai.language.conversations.authoring.models.EntityEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEntityEvaluationSummary", "azure.ai.language.conversations.authoring.models.EvalSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationSummary", "azure.ai.language.conversations.authoring.models.EvaluationDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationOptions", - "azure.ai.language.conversations.authoring.models.EvaluationJobResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationJobResult", - "azure.ai.language.conversations.authoring.models.EvaluationState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringEvaluationJobState", - "azure.ai.language.conversations.authoring.models.ExportedConversationOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedConversationOrchestration", - "azure.ai.language.conversations.authoring.models.ExportedOrchestrationDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedOrchestrationOptions", - "azure.ai.language.conversations.authoring.models.ExportedConversationOrchestrationDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedConversationOrchestrationOptions", - "azure.ai.language.conversations.authoring.models.ExportedEntityList": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityList", - "azure.ai.language.conversations.authoring.models.ExportedEntityListSynonym": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityListSynonym", - "azure.ai.language.conversations.authoring.models.ExportedEntityRegex": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityRegex", - "azure.ai.language.conversations.authoring.models.ExportedEntityRegexExpression": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntityRegexExpression", - "azure.ai.language.conversations.authoring.models.ExportedEntitySublist": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedEntitySublist", - "azure.ai.language.conversations.authoring.models.ExportedLuisOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedLuisOrchestration", - "azure.ai.language.conversations.authoring.models.ExportedLuisOrchestrationDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedLuisOrchestrationOptions", - "azure.ai.language.conversations.authoring.models.ExportedModelDetails": "Language.Conversations.Authoring.ExportedModelOptions", - "azure.ai.language.conversations.authoring.models.ExportedModelState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedModelJobState", - "azure.ai.language.conversations.authoring.models.ExportedPrebuiltEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedPrebuiltEntity", - "azure.ai.language.conversations.authoring.models.ExportedProject": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedProject", - "azure.ai.language.conversations.authoring.models.ExportedQuestionAnsweringOrchestration": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestration", - "azure.ai.language.conversations.authoring.models.ExportedQuestionAnsweringOrchestrationDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedQuestionAnsweringOrchestrationOptions", "azure.ai.language.conversations.authoring.models.ExportedTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedTrainedModel", - "azure.ai.language.conversations.authoring.models.ExportedUtteranceEntityLabel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportedUtteranceEntityLabel", - "azure.ai.language.conversations.authoring.models.ExportProjectState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringExportProjectJobState", - "azure.ai.language.conversations.authoring.models.ImportProjectState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringImportProjectJobState", "azure.ai.language.conversations.authoring.models.IntentEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringIntentEvaluationSummary", "azure.ai.language.conversations.authoring.models.IntentsEvaluationSummary": "Language.Conversations.Authoring.AnalyzeConversationAuthoringIntentsEvaluationSummary", - "azure.ai.language.conversations.authoring.models.LoadSnapshotState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringLoadSnapshotJobState", - "azure.ai.language.conversations.authoring.models.OrchestrationExportedIntent": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedIntent", - "azure.ai.language.conversations.authoring.models.OrchestrationExportedProjectAsset": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedProjectAsset", - "azure.ai.language.conversations.authoring.models.OrchestrationExportedUtterance": "Language.Conversations.Authoring.AnalyzeConversationAuthoringOrchestrationExportedUtterance", "azure.ai.language.conversations.authoring.models.PrebuiltEntity": "Language.Conversations.Authoring.AnalyzeConversationAuthoringPrebuiltEntity", - "azure.ai.language.conversations.authoring.models.ProjectDeletionState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectDeletionJobState", "azure.ai.language.conversations.authoring.models.ProjectDeployment": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectDeployment", "azure.ai.language.conversations.authoring.models.ProjectDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectMetadata", - "azure.ai.language.conversations.authoring.models.ProjectResourceIds": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectAzureResourceIds", - "azure.ai.language.conversations.authoring.models.ProjectResourcesState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourcesJobState", "azure.ai.language.conversations.authoring.models.ProjectSettings": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectSettings", "azure.ai.language.conversations.authoring.models.ProjectTrainedModel": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectTrainedModel", - "azure.ai.language.conversations.authoring.models.ResourceMetadata": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceAssignmentInfo", "azure.ai.language.conversations.authoring.models.SubTrainingState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSubTrainingJobState", "azure.ai.language.conversations.authoring.models.SupportedLanguage": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSupportedLanguage", - "azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSwapDeploymentsOptions", - "azure.ai.language.conversations.authoring.models.SwapDeploymentsState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringSwapDeploymentsJobState", "azure.ai.language.conversations.authoring.models.TrainingConfigVersion": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingConfigVersion", - "azure.ai.language.conversations.authoring.models.TrainingJobDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobOptions", "azure.ai.language.conversations.authoring.models.TrainingJobResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobResult", "azure.ai.language.conversations.authoring.models.TrainingState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringTrainingJobState", "azure.ai.language.conversations.authoring.models.UtteranceEntitiesEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceEntitiesEvaluationResult", @@ -77,13 +30,8 @@ "azure.ai.language.conversations.authoring.models.UtteranceIntentsEvaluationResult": "Language.Conversations.Authoring.AnalyzeConversationAuthoringUtteranceIntentsEvaluationResult", "azure.ai.language.conversations.authoring.models.ProjectKind": "Language.Conversations.Authoring.ProjectKind", "azure.ai.language.conversations.authoring.models.OperationStatus": "Language.Conversations.Authoring.JobStatus", - "azure.ai.language.conversations.authoring.models.DataGenerationConnectionKind": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDataGenerationConnectionKind", "azure.ai.language.conversations.authoring.models.TrainingMode": "Language.Conversations.Authoring.TrainingMode", - "azure.ai.language.conversations.authoring.models.ExportedProjectFormat": "Language.Conversations.Authoring.ExportedProjectFormat", "azure.ai.language.conversations.authoring.models.StringIndexType": "Language.Conversations.Authoring.StringIndexType", - "azure.ai.language.conversations.authoring.models.CompositionMode": "Language.Conversations.Authoring.CompositionSetting", - "azure.ai.language.conversations.authoring.models.DatasetType": "Language.Conversations.Authoring.DatasetType", - "azure.ai.language.conversations.authoring.models.OrchestrationTargetProjectKind": "Language.Conversations.Authoring.OrchestrationTargetProjectKind", "azure.ai.language.conversations.authoring.models.EvaluationKind": "Language.Conversations.Authoring.EvaluationKind", "azure.ai.language.conversations.authoring.ConversationAuthoringClient.list_projects": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.listProjects", "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.list_projects": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.listProjects", @@ -99,91 +47,29 @@ "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.create_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.createProject", "azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getProject", "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getProject", - "azure.ai.language.conversations.authoring.ConversationAuthoringClient.begin_delete_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.deleteProject", - "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.begin_delete_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.deleteProject", - "azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getExportStatus", - "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getExportStatus", - "azure.ai.language.conversations.authoring.ConversationAuthoringClient.get_import_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getImportStatus", - "azure.ai.language.conversations.authoring.aio.ConversationAuthoringClient.get_import_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringClient.getImportStatus", "azure.ai.language.conversations.authoring.operations.DeploymentOperations.get_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeployment", "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.get_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeployment", - "azure.ai.language.conversations.authoring.operations.DeploymentOperations.begin_deploy_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deployProject", - "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.begin_deploy_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deployProject", - "azure.ai.language.conversations.authoring.operations.DeploymentOperations.begin_delete_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deleteDeployment", - "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.begin_delete_deployment": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deleteDeployment", - "azure.ai.language.conversations.authoring.operations.DeploymentOperations.begin_delete_deployment_from_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deleteDeploymentFromResources", - "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.begin_delete_deployment_from_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.deleteDeploymentFromResources", - "azure.ai.language.conversations.authoring.operations.DeploymentOperations.get_deployment_delete_from_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeploymentDeleteFromResourcesStatus", - "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.get_deployment_delete_from_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeploymentDeleteFromResourcesStatus", - "azure.ai.language.conversations.authoring.operations.DeploymentOperations.get_deployment_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeploymentStatus", - "azure.ai.language.conversations.authoring.aio.operations.DeploymentOperations.get_deployment_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.DeploymentOperations.getDeploymentStatus", "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_trained_models": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listTrainedModels", "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_trained_models": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listTrainedModels", "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_training_jobs": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listTrainingJobs", "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_training_jobs": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listTrainingJobs", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listProjectResources", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listProjectResources", + "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listDeploymentResources", + "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listDeploymentResources", "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_deployments": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listDeployments", "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_deployments": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listDeployments", "azure.ai.language.conversations.authoring.operations.ProjectOperations.list_exported_models": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listExportedModels", "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.list_exported_models": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.listExportedModels", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_assign_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignProjectResources", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_assign_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignProjectResources", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_unassign_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignProjectResources", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_unassign_project_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignProjectResources", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_assign_project_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignProjectResourcesStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_assign_project_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignProjectResourcesStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_unassign_project_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignProjectResourcesStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_unassign_project_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignProjectResourcesStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_swap_deployments": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.swapDeployments", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_swap_deployments": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.swapDeployments", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_swap_deployments_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getSwapDeploymentsStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_swap_deployments_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getSwapDeploymentsStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getProject", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getProject", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_project_deletion_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getProjectDeletionStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_project_deletion_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getProjectDeletionStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_import_method": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.import", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_import_method": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.import", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_export": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.export", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_export": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.export", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getExportStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_export_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getExportStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.copy_project_authorization": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.copyProjectAuthorization", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.copy_project_authorization": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.copyProjectAuthorization", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_copy_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.copyProject", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_copy_project": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.copyProject", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_copy_project_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getCopyProjectStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_copy_project_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getCopyProjectStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_train": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.train", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_train": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.train", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_training_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getTrainingStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_training_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getTrainingStatus", "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_cancel_training_job": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.cancelTrainingJob", "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_cancel_training_job": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.cancelTrainingJob", "azure.ai.language.conversations.authoring.operations.ExportedModelOperations.get_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.getExportedModel", "azure.ai.language.conversations.authoring.aio.operations.ExportedModelOperations.get_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.getExportedModel", - "azure.ai.language.conversations.authoring.operations.ExportedModelOperations.begin_delete_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.deleteExportedModel", - "azure.ai.language.conversations.authoring.aio.operations.ExportedModelOperations.begin_delete_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.deleteExportedModel", - "azure.ai.language.conversations.authoring.operations.ExportedModelOperations.begin_create_or_update_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.createOrUpdateExportedModel", - "azure.ai.language.conversations.authoring.aio.operations.ExportedModelOperations.begin_create_or_update_exported_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.createOrUpdateExportedModel", - "azure.ai.language.conversations.authoring.operations.ExportedModelOperations.get_exported_model_job_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.getExportedModelJobStatus", - "azure.ai.language.conversations.authoring.aio.operations.ExportedModelOperations.get_exported_model_job_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ExportedModelOperations.getExportedModelJobStatus", "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.get_trained_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getTrainedModel", "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_trained_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getTrainedModel", "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.delete_trained_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.deleteTrainedModel", "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.delete_trained_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.deleteTrainedModel", - "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.begin_evaluate_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.evaluateModel", - "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.begin_evaluate_model": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.evaluateModel", - "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.begin_load_snapshot": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.loadSnapshot", - "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.begin_load_snapshot": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.loadSnapshot", - "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.get_evaluation_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getEvaluationStatus", - "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_evaluation_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getEvaluationStatus", "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.get_model_evaluation_results": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getModelEvaluationResults", "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_model_evaluation_results": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getModelEvaluationResults", "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.get_model_evaluation_summary": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getModelEvaluationSummary", - "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_model_evaluation_summary": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getModelEvaluationSummary", - "azure.ai.language.conversations.authoring.operations.TrainedModelOperations.get_load_snapshot_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getLoadSnapshotStatus", - "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_load_snapshot_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getLoadSnapshotStatus" + "azure.ai.language.conversations.authoring.aio.operations.TrainedModelOperations.get_model_evaluation_summary": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.TrainedModelOperations.getModelEvaluationSummary" } } \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_client.py index 01d76d5075e7..047b4a6db134 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_client.py @@ -43,8 +43,6 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin): "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. """ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_patch.py index eec33eaeda1c..87676c65a8f0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_patch.py @@ -4,95 +4,18 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- """Customize generated code here. + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, TYPE_CHECKING, Union, Optional -from azure.core.credentials import AzureKeyCredential -from ._client import ConversationAuthoringClient as AuthoringClientGenerated -from ._client import ConversationAuthoringProjectClient as AuthoringProjectClientGenerated -from .operations import DeploymentOperations, ExportedModelOperations, ProjectOperations, TrainedModelOperations - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class ConversationAuthoringProjectClient(AuthoringProjectClientGenerated): - - #: Deployment operations group - deployment: DeploymentOperations - #: Exported model operations group - exported_model: ExportedModelOperations - #: Project operations group - project: ProjectOperations - #: Trained model operations group - trained_model: TrainedModelOperations - - def __init__( # pylint: disable=super-init-not-called - self, - endpoint: str, - credential: Union[AzureKeyCredential, "TokenCredential"], - *, - api_version: Optional[str] = None, - project_name: str, - **kwargs: Any, - ) -> None: - """ - Initialize a ConversationAuthoringProjectClient. - - :param str endpoint: Supported Cognitive Services endpoint, e.g. - ``https://.cognitiveservices.azure.com``. - :param credential: Credential used to authenticate requests to the service. - :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential - :keyword str api_version: The API version to use for this operation. - Default value is ``2025-11-15-preview``. - Note that overriding this default value may result in unsupported behavior. - :keyword str project_name: The name of the project to scope operations. **Required**. - """ - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, project_name=project_name, **kwargs) -class ConversationAuthoringClient(AuthoringClientGenerated): - - def __init__( - self, - endpoint: str, - credential: Union[AzureKeyCredential, "TokenCredential"], - *, - api_version: Optional[str] = None, - **kwargs: Any, - ) -> None: - """ - Create a ConversationAuthoringClient. - - :param str endpoint: Supported Cognitive Services endpoint, e.g. - ``https://.api.cognitiveservices.azure.com``. - :param credential: Key or token credential. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword str api_version: The API version to use for this operation. - Default value is ``2025-11-15-preview``. - Note that overriding this default value may result in unsupported behavior. - """ - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, **kwargs) - - def get_project_client(self, project_name: str) -> ConversationAuthoringProjectClient: - return ConversationAuthoringProjectClient( - endpoint=self._config.endpoint, - credential=self._config.credential, - project_name=project_name, - ) +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): """Do not remove from this file. + `patch_sdk` is a last resort escape hatch that allows you to do customizations you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ConversationAuthoringProjectClient", "ConversationAuthoringClient"] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/model_base.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/model_base.py index 430bda7b37fc..12926fa98dcf 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/model_base.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/model_base.py @@ -22,7 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from collections.abc import MutableMapping # pylint:disable=import-error +from collections.abc import MutableMapping from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -640,7 +640,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint:disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_version.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_version.py index bbcd28b4aa67..c43fdbc2e239 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_version.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b3" diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_client.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_client.py index 650dad14a28b..2857b302e5db 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_client.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_client.py @@ -43,8 +43,6 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin): "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. """ def __init__( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py index 6475d80052f3..87676c65a8f0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py @@ -4,95 +4,18 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- """Customize generated code here. + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, TYPE_CHECKING, Union, Optional -from azure.core.credentials import AzureKeyCredential -from ._client import ConversationAuthoringClient as AuthoringClientGenerated -from ._client import ConversationAuthoringProjectClient as AuthoringProjectClientGenerated -from .operations import DeploymentOperations, ExportedModelOperations, ProjectOperations, TrainedModelOperations - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class ConversationAuthoringProjectClient(AuthoringProjectClientGenerated): - - #: Deployment operations group - deployment: DeploymentOperations - #: Exported model operations group - exported_model: ExportedModelOperations - #: Project operations group - project: ProjectOperations - #: Trained model operations group - trained_model: TrainedModelOperations - - def __init__( - self, - endpoint: str, - credential: Union[AzureKeyCredential, "AsyncTokenCredential"], - *, - api_version: Optional[str] = None, - project_name: str, - **kwargs: Any, - ) -> None: - """Initialize a ConversationAuthoringProjectClient. - - :param str endpoint: Supported Cognitive Services endpoint, e.g. - "https://.cognitiveservices.azure.com". - :param credential: Credential used to authenticate requests to the service. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword str api_version: The API version to use for this operation. - Default value is ``2025-05-15-preview``. - Note that overriding this default value may result in unsupported behavior. - :keyword str project_name: The name of the project to scope operations. Required. - """ - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, project_name=project_name, **kwargs) -class ConversationAuthoringClient(AuthoringClientGenerated): - - def __init__( - self, - endpoint: str, - credential: Union[AzureKeyCredential, "AsyncTokenCredential"], - *, - api_version: Optional[str] = None, - **kwargs: Any, - ) -> None: - """ - Create a ConversationAuthoringClient. - - :param str endpoint: Supported Cognitive Services endpoint, e.g. - ``https://.api.cognitiveservices.azure.com``. - :param credential: Key or token credential. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword str api_version: The API version to use for this operation. - Default value is ``2025-05-15-preview``. - Note that overriding this default value may result in unsupported behavior. - """ - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, **kwargs) - - def get_project_client(self, project_name: str) -> ConversationAuthoringProjectClient: - return ConversationAuthoringProjectClient( - endpoint=self._config.endpoint, - credential=self._config.credential, - project_name=project_name, - ) +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): """Do not remove from this file. + `patch_sdk` is a last resort escape hatch that allows you to do customizations you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ConversationAuthoringProjectClient", "ConversationAuthoringClient"] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_operations.py index 32e8759647ed..768de454d6e2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from collections.abc import MutableMapping # pylint:disable=import-error +from collections.abc import MutableMapping from io import IOBase import json from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload @@ -58,28 +58,28 @@ build_exported_model_delete_exported_model_request, build_exported_model_get_exported_model_job_status_request, build_exported_model_get_exported_model_request, - build_project_assign_project_resources_request, + build_project_assign_deployment_resources_request, build_project_cancel_training_job_request, build_project_copy_project_authorization_request, build_project_copy_project_request, build_project_export_request, - build_project_get_assign_project_resources_status_request, + build_project_get_assign_deployment_resources_status_request, build_project_get_copy_project_status_request, build_project_get_export_status_request, build_project_get_project_deletion_status_request, build_project_get_project_request, build_project_get_swap_deployments_status_request, build_project_get_training_status_request, - build_project_get_unassign_project_resources_status_request, + build_project_get_unassign_deployment_resources_status_request, build_project_import_method_request, + build_project_list_deployment_resources_request, build_project_list_deployments_request, build_project_list_exported_models_request, - build_project_list_project_resources_request, build_project_list_trained_models_request, build_project_list_training_jobs_request, build_project_swap_deployments_request, build_project_train_request, - build_project_unassign_project_resources_request, + build_project_unassign_deployment_resources_request, build_trained_model_delete_trained_model_request, build_trained_model_evaluate_model_request, build_trained_model_get_evaluation_status_request, @@ -852,7 +852,7 @@ async def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Asy return deserialized # type: ignore @distributed_trace_async - async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def _begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Deletes a project. :param project_name: The name of the project to use. Required. @@ -902,7 +902,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ExportProjectState: + async def _get_export_status( + self, project_name: str, job_id: str, **kwargs: Any + ) -> _models._models.ExportProjectState: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. :param project_name: The new project name. Required. @@ -910,7 +912,7 @@ async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -924,7 +926,7 @@ async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_export_status_request( project_name=project_name, @@ -957,7 +959,9 @@ async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ExportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -965,7 +969,9 @@ async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace_async - async def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ImportProjectState: + async def _get_import_status( + self, project_name: str, job_id: str, **kwargs: Any + ) -> _models._models.ImportProjectState: """Gets the status for an import. :param project_name: The new project name. Required. @@ -973,7 +979,7 @@ async def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) :param job_id: The job ID. Required. :type job_id: str :return: ImportProjectState. The ImportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ImportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ImportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -987,7 +993,7 @@ async def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ImportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ImportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_import_status_request( project_name=project_name, @@ -1020,7 +1026,9 @@ async def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ImportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ImportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1109,7 +1117,7 @@ async def get_deployment(self, deployment_name: str, **kwargs: Any) -> _models.P return deserialized # type: ignore async def _deploy_project_initial( - self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1172,67 +1180,26 @@ async def _deploy_project_initial( return deserialized # type: ignore @overload - async def begin_deploy_project( + async def _begin_deploy_project( self, deployment_name: str, - body: _models.CreateDeploymentDetails, + body: _models._models.CreateDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_deploy_project( + async def _begin_deploy_project( self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_deploy_project( + async def _begin_deploy_project( self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def begin_deploy_project( - self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_deploy_project( + self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Creates a new deployment or replaces an existing one. @@ -1240,8 +1207,8 @@ async def begin_deploy_project( :type deployment_name: str :param body: The new deployment info. Is one of the following types: CreateDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails or JSON - or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.CreateDeploymentDetails + or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1345,7 +1312,7 @@ async def _delete_deployment_initial(self, deployment_name: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace_async - async def begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def _begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Deletes a project deployment. :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -1400,7 +1367,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) async def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long - self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1463,69 +1430,22 @@ async def _delete_deployment_from_resources_initial( # pylint: disable=name-too return deserialized # type: ignore @overload - async def begin_delete_deployment_from_resources( + async def _begin_delete_deployment_from_resources( self, deployment_name: str, - body: _models.ProjectResourceIds, + body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_delete_deployment_from_resources( + async def _begin_delete_deployment_from_resources( self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_delete_deployment_from_resources( + async def _begin_delete_deployment_from_resources( self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( @@ -1533,8 +1453,8 @@ async def begin_delete_deployment_from_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "deployment_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_delete_deployment_from_resources( - self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + async def _begin_delete_deployment_from_resources( + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -1542,9 +1462,9 @@ async def begin_delete_deployment_from_resources( :type deployment_name: str :param body: The Language or AIService resource list for deleting the deployment.\\r\\n The deployment will only be deleted from the specified resources, and will remain for the rest. - Is one of the following types: ProjectResourceIds, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or - IO[bytes] + Is one of the following types: DeleteDeploymentDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails + or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1602,9 +1522,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "deployment_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def get_deployment_delete_from_resources_status( # pylint: disable=name-too-long + async def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-long self, deployment_name: str, job_id: str, **kwargs: Any - ) -> _models.DeploymentDeleteFromResourcesState: + ) -> _models._models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. :param deployment_name: Represents deployment name. Required. @@ -1613,7 +1533,8 @@ async def get_deployment_delete_from_resources_status( # pylint: disable=name-t :type job_id: str :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState + :rtype: + ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1627,7 +1548,7 @@ async def get_deployment_delete_from_resources_status( # pylint: disable=name-t _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( deployment_name=deployment_name, @@ -1661,7 +1582,9 @@ async def get_deployment_delete_from_resources_status( # pylint: disable=name-t if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentDeleteFromResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentDeleteFromResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1669,7 +1592,9 @@ async def get_deployment_delete_from_resources_status( # pylint: disable=name-t return deserialized # type: ignore @distributed_trace_async - async def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any) -> _models.DeploymentState: + async def _get_deployment_status( + self, deployment_name: str, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentState: """Gets the status of an existing deployment job. :param deployment_name: Represents deployment name. Required. @@ -1677,7 +1602,7 @@ async def get_deployment_status(self, deployment_name: str, job_id: str, **kwarg :param job_id: The job ID. Required. :type job_id: str :return: DeploymentState. The DeploymentState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentState + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1691,7 +1616,7 @@ async def get_deployment_status(self, deployment_name: str, job_id: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( deployment_name=deployment_name, @@ -1725,7 +1650,9 @@ async def get_deployment_status(self, deployment_name: str, job_id: str, **kwarg if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1946,25 +1873,25 @@ async def get_next(next_link=None): params_added_on={"2025-11-01": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def list_project_resources( + def list_deployment_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AssignedProjectResource"]: + ) -> AsyncItemPaged["_models.AssignedDeploymentResource"]: """Lists the Language or AIService resources assigned to the project. :keyword top: The number of result items to return. Default value is None. :paramtype top: int :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int - :return: An iterator like instance of AssignedProjectResource + :return: An iterator like instance of AssignedDeploymentResource :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[list[_models.AssignedProjectResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1977,7 +1904,7 @@ def list_project_resources( def prepare_request(next_link=None): if not next_link: - _request = build_project_list_project_resources_request( + _request = build_project_list_deployment_resources_request( project_name=self._config.project_name, top=top, skip=skip, @@ -2017,7 +1944,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(list[_models.AssignedProjectResource], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedDeploymentResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2237,8 +2164,8 @@ async def get_next(next_link=None): params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def _assign_project_resources_initial( - self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any + async def _assign_deployment_resources_initial( + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2261,7 +2188,7 @@ async def _assign_project_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_assign_project_resources_request( + _request = build_project_assign_deployment_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -2300,64 +2227,21 @@ async def _assign_project_resources_initial( return deserialized # type: ignore @overload - async def begin_assign_project_resources( - self, body: _models.AssignProjectResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_assign_deployment_resources( + self, + body: _models._models.AssignDeploymentResourcesDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - async def begin_assign_project_resources( + async def _begin_assign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_assign_project_resources( + async def _begin_assign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( @@ -2365,8 +2249,8 @@ async def begin_assign_project_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_assign_project_resources( - self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_assign_deployment_resources( + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. This API is available only via AAD authentication and not supported via subscription key @@ -2375,8 +2259,9 @@ async def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Is one of the following types: - AssignProjectResourcesDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails or + AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. + :type body: + ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -2391,7 +2276,7 @@ async def begin_assign_project_resources( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._assign_project_resources_initial( + raw_result = await self._assign_deployment_resources_initial( body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore @@ -2428,8 +2313,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def _unassign_project_resources_initial( - self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + async def _unassign_deployment_resources_initial( + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2452,7 +2337,7 @@ async def _unassign_project_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_unassign_project_resources_request( + _request = build_project_unassign_deployment_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -2491,52 +2376,17 @@ async def _unassign_project_resources_initial( return deserialized # type: ignore @overload - async def begin_unassign_project_resources( - self, body: _models.ProjectResourceIds, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_unassign_deployment_resources( + self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - async def begin_unassign_project_resources( + async def _begin_unassign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_unassign_project_resources( + async def _begin_unassign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( @@ -2544,15 +2394,15 @@ async def begin_unassign_project_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_unassign_project_resources( - self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + async def _begin_unassign_deployment_resources( + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. :param body: The list of Language or AIService Azure resource IDs to be unassigned. Is one of - the following types: ProjectResourceIds, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or - IO[bytes] + the following types: DeleteDeploymentDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails + or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2566,7 +2416,7 @@ async def begin_unassign_project_resources( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._unassign_project_resources_initial( + raw_result = await self._unassign_deployment_resources_initial( body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore @@ -2604,13 +2454,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: + async def _get_assign_deployment_resources_status( + self, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState + :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with + MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2624,9 +2477,9 @@ async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_assign_project_resources_status_request( + _request = build_project_get_assign_deployment_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -2657,7 +2510,9 @@ async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2670,13 +2525,16 @@ async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) params_added_on={"2025-11-01": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - async def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: + async def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long + self, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState + :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with + MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2690,9 +2548,9 @@ async def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_unassign_project_resources_status_request( + _request = build_project_get_unassign_deployment_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -2723,7 +2581,9 @@ async def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2731,7 +2591,7 @@ async def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any return deserialized # type: ignore async def _swap_deployments_initial( - self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2793,63 +2653,28 @@ async def _swap_deployments_initial( return deserialized # type: ignore @overload - async def begin_swap_deployments( - self, body: _models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_swap_deployments( + self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - async def begin_swap_deployments( + async def _begin_swap_deployments( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_swap_deployments( + async def _begin_swap_deployments( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def begin_swap_deployments( - self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_swap_deployments( + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Swaps two existing deployments with each other. :param body: The job object to swap two deployments. Is one of the following types: SwapDeploymentsDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.SwapDeploymentsDetails or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2896,13 +2721,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models.SwapDeploymentsState: + async def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models._models.SwapDeploymentsState: """Gets the status of an existing swap deployment job. :param job_id: The job ID. Required. :type job_id: str :return: SwapDeploymentsState. The SwapDeploymentsState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsState + :rtype: ~azure.ai.language.conversations.authoring.models._models.SwapDeploymentsState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2916,7 +2741,7 @@ async def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SwapDeploymentsState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( job_id=job_id, @@ -2949,7 +2774,9 @@ async def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mode if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SwapDeploymentsState, response.json()) + deserialized = _deserialize( + _models._models.SwapDeploymentsState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2957,7 +2784,7 @@ async def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mode return deserialized # type: ignore @distributed_trace_async - async def get_project(self, **kwargs: Any) -> _models.ProjectDetails: + async def _get_project(self, **kwargs: Any) -> _models.ProjectDetails: """Gets the details of a project. :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping @@ -3015,13 +2842,13 @@ async def get_project(self, **kwargs: Any) -> _models.ProjectDetails: return deserialized # type: ignore @distributed_trace_async - async def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models.ProjectDeletionState: + async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._models.ProjectDeletionState: """Gets the status for a project deletion job. :param job_id: The job ID. Required. :type job_id: str :return: ProjectDeletionState. The ProjectDeletionState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeletionState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ProjectDeletionState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3035,7 +2862,7 @@ async def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectDeletionState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ProjectDeletionState] = kwargs.pop("cls", None) _request = build_project_get_project_deletion_status_request( job_id=job_id, @@ -3067,7 +2894,9 @@ async def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mode if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectDeletionState, response.json()) + deserialized = _deserialize( + _models._models.ProjectDeletionState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3076,9 +2905,9 @@ async def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mode async def _import_method_initial( self, - body: Union[_models.ExportedProject, JSON, IO[bytes]], + body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3142,89 +2971,39 @@ async def _import_method_initial( return deserialized # type: ignore @overload - async def begin_import( + async def _begin_import_method( self, - body: _models.ExportedProject, + body: _models._models.ExportedProject, *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedProject - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_import( + async def _begin_import_method( self, body: JSON, *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: JSON - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_import( + async def _begin_import_method( self, body: IO[bytes], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: IO[bytes] - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def begin_import( + async def _begin_import_method( self, - body: Union[_models.ExportedProject, JSON, IO[bytes]], + body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, **kwargs: Any ) -> AsyncLROPoller[None]: """Triggers a job to import a project. If a project with the same name already exists, the data of @@ -3232,8 +3011,8 @@ async def begin_import( :param body: The project data to import. Is one of the following types: ExportedProject, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedProject or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.ExportedProject or JSON + or IO[bytes] :keyword exported_project_format: The format of the exported project file to use. Known values are: "Conversation" and "Luis". Default value is None. :paramtype exported_project_format: str or @@ -3293,7 +3072,7 @@ async def _export_initial( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -3352,11 +3131,11 @@ async def _export_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_export( + async def _begin_export( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -3430,13 +3209,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportProjectState: + async def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._models.ExportProjectState: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3450,7 +3229,7 @@ async def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportP _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( job_id=job_id, @@ -3483,7 +3262,9 @@ async def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportP if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ExportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3491,7 +3272,7 @@ async def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportP return deserialized # type: ignore @overload - async def copy_project_authorization( + async def _copy_project_authorization( self, *, project_kind: Union[str, _models.ProjectKind], @@ -3499,57 +3280,15 @@ async def copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :keyword project_kind: Represents the project kind. Known values are: "Conversation", - "Orchestration", and "CustomConversationSummarization". Required. - :paramtype project_kind: str or ~azure.ai.language.conversations.authoring.models.ProjectKind - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword storage_input_container_name: The name of the storage container. Default value is - None. - :paramtype storage_input_container_name: str - :keyword allow_overwrite: Whether to allow an existing project to be overwritten using the - resulting copy authorization. Default value is None. - :paramtype allow_overwrite: bool - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> _models._models.CopyProjectDetails: ... @overload - async def copy_project_authorization( + async def _copy_project_authorization( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> _models._models.CopyProjectDetails: ... @overload - async def copy_project_authorization( + async def _copy_project_authorization( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> _models._models.CopyProjectDetails: ... @distributed_trace_async @api_version_validation( @@ -3557,7 +3296,7 @@ async def copy_project_authorization( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "content_type", "accept"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def copy_project_authorization( + async def _copy_project_authorization( self, body: Union[JSON, IO[bytes]] = _Unset, *, @@ -3565,7 +3304,7 @@ async def copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models.CopyProjectDetails: + ) -> _models._models.CopyProjectDetails: """Generates a copy project operation authorization to the current target Azure resource. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -3580,7 +3319,7 @@ async def copy_project_authorization( resulting copy authorization. Default value is None. :paramtype allow_overwrite: bool :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails + :rtype: ~azure.ai.language.conversations.authoring.models._models.CopyProjectDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3595,7 +3334,7 @@ async def copy_project_authorization( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CopyProjectDetails] = kwargs.pop("cls", None) + cls: ClsType[_models._models.CopyProjectDetails] = kwargs.pop("cls", None) if body is _Unset: if project_kind is _Unset: @@ -3645,7 +3384,9 @@ async def copy_project_authorization( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.CopyProjectDetails, response.json()) + deserialized = _deserialize( + _models._models.CopyProjectDetails, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3658,7 +3399,7 @@ async def copy_project_authorization( api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) async def _copy_project_initial( - self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3720,52 +3461,17 @@ async def _copy_project_initial( return deserialized # type: ignore @overload - async def begin_copy_project( - self, body: _models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_copy_project( + self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - async def begin_copy_project( + async def _begin_copy_project( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_copy_project( + async def _begin_copy_project( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( @@ -3773,15 +3479,15 @@ async def begin_copy_project( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_copy_project( - self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_copy_project( + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Copies an existing project to another Azure resource. :param body: The copy project info. Is one of the following types: CopyProjectDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.CopyProjectDetails or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3833,13 +3539,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-05-15-preview": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.CopyProjectState: + async def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models._models.CopyProjectState: """Gets the status of an existing copy project job. :param job_id: The job ID. Required. :type job_id: str :return: CopyProjectState. The CopyProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.CopyProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3853,7 +3559,7 @@ async def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.C _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CopyProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( job_id=job_id, @@ -3886,7 +3592,9 @@ async def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.C if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.CopyProjectState, response.json()) + deserialized = _deserialize( + _models._models.CopyProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3894,7 +3602,7 @@ async def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.C return deserialized # type: ignore async def _train_initial( - self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3956,69 +3664,28 @@ async def _train_initial( return deserialized # type: ignore @overload - async def begin_train( - self, body: _models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_train( + self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @overload - async def begin_train( + async def _begin_train( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @overload - async def begin_train( + async def _begin_train( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @distributed_trace_async - async def begin_train( - self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_train( + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.TrainingJobResult]: """Triggers a training job for a project. :param body: The training input parameters. Is one of the following types: TrainingJobDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.TrainingJobDetails or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is compatible with MutableMapping :rtype: @@ -4077,7 +3744,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace_async - async def get_training_status(self, job_id: str, **kwargs: Any) -> _models.TrainingState: + async def _get_training_status(self, job_id: str, **kwargs: Any) -> _models.TrainingState: """Gets the status for a training job. :param job_id: The job ID. Required. @@ -4398,7 +4065,7 @@ async def _delete_exported_model_initial(self, exported_model_name: str, **kwarg params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_delete_exported_model(self, exported_model_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def _begin_delete_exported_model(self, exported_model_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Deletes an existing exported model. :param exported_model_name: The exported model name. Required. @@ -4457,7 +4124,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) async def _create_or_update_exported_model_initial( - self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any + self, + exported_model_name: str, + body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4520,63 +4190,22 @@ async def _create_or_update_exported_model_initial( return deserialized # type: ignore @overload - async def begin_create_or_update_exported_model( + async def _begin_create_or_update_exported_model( self, exported_model_name: str, - body: _models.ExportedModelDetails, + body: _models._models.ExportedModelDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_create_or_update_exported_model( + async def _begin_create_or_update_exported_model( self, exported_model_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[None]: ... @overload - async def begin_create_or_update_exported_model( + async def _begin_create_or_update_exported_model( self, exported_model_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( @@ -4584,8 +4213,11 @@ async def begin_create_or_update_exported_model( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_create_or_update_exported_model( - self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any + async def _begin_create_or_update_exported_model( + self, + exported_model_name: str, + body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[None]: """Creates a new exported model or replaces an existing one. @@ -4593,8 +4225,8 @@ async def begin_create_or_update_exported_model( :type exported_model_name: str :param body: The exported model info. Is one of the following types: ExportedModelDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.ExportedModelDetails or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -4654,9 +4286,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- }, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def get_exported_model_job_status( + async def _get_exported_model_job_status( self, exported_model_name: str, job_id: str, **kwargs: Any - ) -> _models.ExportedModelState: + ) -> _models._models.ExportedModelState: """Gets the status for an existing job to create or update an exported model. :param exported_model_name: The exported model name. Required. @@ -4664,7 +4296,7 @@ async def get_exported_model_job_status( :param job_id: The job ID. Required. :type job_id: str :return: ExportedModelState. The ExportedModelState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportedModelState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportedModelState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4678,7 +4310,7 @@ async def get_exported_model_job_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportedModelState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( exported_model_name=exported_model_name, @@ -4712,7 +4344,9 @@ async def get_exported_model_job_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportedModelState, response.json()) + deserialized = _deserialize( + _models._models.ExportedModelState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4918,69 +4552,22 @@ async def _evaluate_model_initial( return deserialized # type: ignore @overload - async def begin_evaluate_model( + async def _begin_evaluate_model( self, trained_model_label: str, body: _models.EvaluationDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: ~azure.ai.language.conversations.authoring.models.EvaluationDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EvaluationJobResult. The - EvaluationJobResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @overload - async def begin_evaluate_model( + async def _begin_evaluate_model( self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EvaluationJobResult. The - EvaluationJobResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @overload - async def begin_evaluate_model( + async def _begin_evaluate_model( self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EvaluationJobResult. The - EvaluationJobResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @distributed_trace_async @api_version_validation( @@ -4988,9 +4575,9 @@ async def begin_evaluate_model( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def begin_evaluate_model( + async def _begin_evaluate_model( self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.EvaluationJobResult]: + ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. :param trained_model_label: The trained model label. Required. @@ -5002,14 +4589,14 @@ async def begin_evaluate_model( :return: An instance of AsyncLROPoller that returns EvaluationJobResult. The EvaluationJobResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] + ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models._models.EvaluationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models._models.EvaluationJobResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -5033,7 +4620,10 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.EvaluationJobResult, response.json().get("result", {})) + deserialized = _deserialize( + _models._models.EvaluationJobResult, # pylint: disable=protected-access + response.json().get("result", {}), + ) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -5052,13 +4642,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.EvaluationJobResult].from_continuation_token( + return AsyncLROPoller[_models._models.EvaluationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.EvaluationJobResult]( + return AsyncLROPoller[_models._models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -5114,7 +4704,7 @@ async def _load_snapshot_initial(self, trained_model_label: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace_async - async def begin_load_snapshot(self, trained_model_label: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def _begin_load_snapshot(self, trained_model_label: str, **kwargs: Any) -> AsyncLROPoller[None]: """Restores the snapshot of this trained model to be the current working directory of the project. :param trained_model_label: The trained model label. Required. @@ -5175,9 +4765,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- }, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def get_evaluation_status( + async def _get_evaluation_status( self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> _models.EvaluationState: + ) -> _models._models.EvaluationState: """Gets the status for an evaluation job. :param trained_model_label: The trained model label. Required. @@ -5185,7 +4775,7 @@ async def get_evaluation_status( :param job_id: The job ID. Required. :type job_id: str :return: EvaluationState. The EvaluationState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.EvaluationState + :rtype: ~azure.ai.language.conversations.authoring.models._models.EvaluationState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5199,7 +4789,7 @@ async def get_evaluation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( trained_model_label=trained_model_label, @@ -5233,7 +4823,9 @@ async def get_evaluation_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationState, response.json()) + deserialized = _deserialize( + _models._models.EvaluationState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5414,9 +5006,9 @@ async def get_model_evaluation_summary(self, trained_model_label: str, **kwargs: return deserialized # type: ignore @distributed_trace_async - async def get_load_snapshot_status( + async def _get_load_snapshot_status( self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> _models.LoadSnapshotState: + ) -> _models._models.LoadSnapshotState: """Gets the status for loading a snapshot. :param trained_model_label: The trained model label. Required. @@ -5424,7 +5016,7 @@ async def get_load_snapshot_status( :param job_id: The job ID. Required. :type job_id: str :return: LoadSnapshotState. The LoadSnapshotState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.LoadSnapshotState + :rtype: ~azure.ai.language.conversations.authoring.models._models.LoadSnapshotState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5438,7 +5030,7 @@ async def get_load_snapshot_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LoadSnapshotState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( trained_model_label=trained_model_label, @@ -5472,7 +5064,9 @@ async def get_load_snapshot_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.LoadSnapshotState, response.json()) + deserialized = _deserialize( + _models._models.LoadSnapshotState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_patch.py index d16191ea330a..87676c65a8f0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_patch.py @@ -1,21 +1,21 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- """Customize generated code here. + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from ._project_op_patch import ProjectOperations + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): """Do not remove from this file. + `patch_sdk` is a last resort escape hatch that allows you to do customizations you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ProjectOperations"] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py deleted file mode 100644 index 9e09ee691be6..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py +++ /dev/null @@ -1,104 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from collections.abc import MutableMapping # pylint:disable=import-error -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator_async import distributed_trace_async - -from ..._utils.model_base import _deserialize -from ...models._patch import _AsyncJobsPollingMethod -from ...models import ( - TrainingJobResult, -) -from ._operations import ProjectOperations as ProjectOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -_Unset: Any = object() -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - - -class ProjectOperations(ProjectOperationsGenerated): - """Patched ProjectOperationsOperations that auto-injects project_name.""" - - @distributed_trace_async - async def begin_cancel_training_job( # type: ignore[override] - self, job_id: str, **kwargs: Any - ) -> AsyncLROPoller[TrainingJobResult]: - """ - Cancel a training job. - :param job_id: The identifier of the training job to cancel. Required. - :type job_id: str - :return: An instance of AsyncLROPoller that returns TrainingJobResult. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[TrainingJobResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - - if cont_token is None: - # Fire the initial cancel request; keep PipelineResponse for the poller - initial = await self._cancel_training_job_initial( # returns PipelineResponse project_name=self._project_name, - job_id=job_id, - cls=lambda x, y, z: x, # passthrough PipelineResponse - headers=_headers, - params=_params, - **kwargs, - ) - await initial.http_response.read() # type: ignore[attr-defined] - kwargs.pop("error_map", None) - - # Deserialization callback: map the nested "result" object to TrainingJobResult - def get_long_running_output(pipeline_response): - body = pipeline_response.http_response.json() or {} - result_dict = body.get("result", {}) or {} - obj = _deserialize(TrainingJobResult, result_dict) - if cls: - return cls(pipeline_response, obj, {}) # type: ignore[misc] - return obj - - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - _AsyncJobsPollingMethod( - polling_interval=lro_delay, - path_format_arguments=path_format_arguments, - ), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - - if cont_token: - return AsyncLROPoller[TrainingJobResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - - return AsyncLROPoller[TrainingJobResult]( - self._client, - initial, # type: ignore - get_long_running_output, - polling_method, # type: ignore[arg-type] - ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/__init__.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/__init__.py index cf78e10fa6c9..6115d15497a5 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/__init__.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/__init__.py @@ -14,74 +14,27 @@ from ._models import ( # type: ignore - AssignProjectResourcesDetails, + AssignedDeploymentResource, AssignedProjectDeploymentMetadata, AssignedProjectDeploymentsMetadata, - AssignedProjectResource, ConfusionMatrixCell, ConfusionMatrixRow, - ConversationExportedAssociatedEntityLabel, - ConversationExportedEntity, - ConversationExportedIntent, - ConversationExportedProjectAsset, - ConversationExportedUtterance, - CopyProjectDetails, - CopyProjectState, - CreateDeploymentDetails, CreateProjectOptions, - DataGenerationConnectionInfo, - DataGenerationSettings, - DeploymentDeleteFromResourcesState, - DeploymentResource, - DeploymentState, EntitiesEvaluationSummary, EntityEvaluationSummary, EvalSummary, EvaluationDetails, - EvaluationJobResult, - EvaluationState, - ExportProjectState, - ExportedConversationOrchestration, - ExportedConversationOrchestrationDetails, - ExportedEntityList, - ExportedEntityListSynonym, - ExportedEntityRegex, - ExportedEntityRegexExpression, - ExportedEntitySublist, - ExportedLuisOrchestration, - ExportedLuisOrchestrationDetails, - ExportedModelDetails, - ExportedModelState, - ExportedOrchestrationDetails, - ExportedPrebuiltEntity, - ExportedProject, - ExportedProjectAsset, - ExportedQuestionAnsweringOrchestration, - ExportedQuestionAnsweringOrchestrationDetails, ExportedTrainedModel, - ExportedUtteranceEntityLabel, - ImportProjectState, IntentEvaluationSummary, IntentsEvaluationSummary, - LoadSnapshotState, - OrchestrationExportedIntent, - OrchestrationExportedProjectAsset, - OrchestrationExportedUtterance, PrebuiltEntity, - ProjectDeletionState, ProjectDeployment, ProjectDetails, - ProjectResourceIds, - ProjectResourcesState, ProjectSettings, ProjectTrainedModel, - ResourceMetadata, SubTrainingState, SupportedLanguage, - SwapDeploymentsDetails, - SwapDeploymentsState, TrainingConfigVersion, - TrainingJobDetails, TrainingJobResult, TrainingState, UtteranceEntitiesEvaluationResult, @@ -91,13 +44,8 @@ ) from ._enums import ( # type: ignore - CompositionMode, - DataGenerationConnectionKind, - DatasetType, EvaluationKind, - ExportedProjectFormat, OperationStatus, - OrchestrationTargetProjectKind, ProjectKind, StringIndexType, TrainingMode, @@ -107,87 +55,35 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AssignProjectResourcesDetails", + "AssignedDeploymentResource", "AssignedProjectDeploymentMetadata", "AssignedProjectDeploymentsMetadata", - "AssignedProjectResource", "ConfusionMatrixCell", "ConfusionMatrixRow", - "ConversationExportedAssociatedEntityLabel", - "ConversationExportedEntity", - "ConversationExportedIntent", - "ConversationExportedProjectAsset", - "ConversationExportedUtterance", - "CopyProjectDetails", - "CopyProjectState", - "CreateDeploymentDetails", "CreateProjectOptions", - "DataGenerationConnectionInfo", - "DataGenerationSettings", - "DeploymentDeleteFromResourcesState", - "DeploymentResource", - "DeploymentState", "EntitiesEvaluationSummary", "EntityEvaluationSummary", "EvalSummary", "EvaluationDetails", - "EvaluationJobResult", - "EvaluationState", - "ExportProjectState", - "ExportedConversationOrchestration", - "ExportedConversationOrchestrationDetails", - "ExportedEntityList", - "ExportedEntityListSynonym", - "ExportedEntityRegex", - "ExportedEntityRegexExpression", - "ExportedEntitySublist", - "ExportedLuisOrchestration", - "ExportedLuisOrchestrationDetails", - "ExportedModelDetails", - "ExportedModelState", - "ExportedOrchestrationDetails", - "ExportedPrebuiltEntity", - "ExportedProject", - "ExportedProjectAsset", - "ExportedQuestionAnsweringOrchestration", - "ExportedQuestionAnsweringOrchestrationDetails", "ExportedTrainedModel", - "ExportedUtteranceEntityLabel", - "ImportProjectState", "IntentEvaluationSummary", "IntentsEvaluationSummary", - "LoadSnapshotState", - "OrchestrationExportedIntent", - "OrchestrationExportedProjectAsset", - "OrchestrationExportedUtterance", "PrebuiltEntity", - "ProjectDeletionState", "ProjectDeployment", "ProjectDetails", - "ProjectResourceIds", - "ProjectResourcesState", "ProjectSettings", "ProjectTrainedModel", - "ResourceMetadata", "SubTrainingState", "SupportedLanguage", - "SwapDeploymentsDetails", - "SwapDeploymentsState", "TrainingConfigVersion", - "TrainingJobDetails", "TrainingJobResult", "TrainingState", "UtteranceEntitiesEvaluationResult", "UtteranceEntityEvaluationResult", "UtteranceEvaluationResult", "UtteranceIntentsEvaluationResult", - "CompositionMode", - "DataGenerationConnectionKind", - "DatasetType", "EvaluationKind", - "ExportedProjectFormat", "OperationStatus", - "OrchestrationTargetProjectKind", "ProjectKind", "StringIndexType", "TrainingMode", diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py index 1a7d9787fed1..588388782d2a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py @@ -20,35 +20,24 @@ from .. import models as _models -class AssignedProjectDeploymentMetadata(_Model): - """Represents the metadata for an assigned deployment. +class AssignDeploymentResourcesDetails(_Model): + """Represents the payload for assigning Azure resources to a project. - :ivar deployment_name: Represents the deployment name. Required. - :vartype deployment_name: str - :ivar last_deployed_on: Represents deployment last deployed time. Required. - :vartype last_deployed_on: ~datetime.datetime - :ivar deployment_expires_on: Represents deployment expiration date in the runtime. Required. - :vartype deployment_expires_on: ~datetime.date + :ivar metadata: Represents the metadata for the project resources to be assigned. Required. + :vartype metadata: + list[~azure.ai.language.conversations.authoring.models._models.ResourceMetadata] """ - deployment_name: str = rest_field(name="deploymentName", visibility=["read", "create", "update", "delete", "query"]) - """Represents the deployment name. Required.""" - last_deployed_on: datetime.datetime = rest_field( - name="lastDeployedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Represents deployment last deployed time. Required.""" - deployment_expires_on: datetime.date = rest_field( - name="deploymentExpirationDate", visibility=["read", "create", "update", "delete", "query"] + metadata: list["_models._models.ResourceMetadata"] = rest_field( + name="projectResources", visibility=["read", "create", "update", "delete", "query"] ) - """Represents deployment expiration date in the runtime. Required.""" + """Represents the metadata for the project resources to be assigned. Required.""" @overload def __init__( self, *, - deployment_name: str, - last_deployed_on: datetime.datetime, - deployment_expires_on: datetime.date, + metadata: list["_models._models.ResourceMetadata"], ) -> None: ... @overload @@ -62,28 +51,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignedProjectDeploymentsMetadata(_Model): - """Represents the metadata for assigned deployments for a project. +class AssignedDeploymentResource(_Model): + """Represents the assigned project resource. - :ivar project_name: Represents the project name. Required. - :vartype project_name: str - :ivar deployments_metadata: Represents the resource region. Required. - :vartype deployments_metadata: - list[~azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentMetadata] + :ivar resource_id: The Azure resource ID of the language or AI resource. Required. + :vartype resource_id: str + :ivar region: The Azure resource region. Required. + :vartype region: str """ - project_name: str = rest_field(name="projectName", visibility=["read"]) - """Represents the project name. Required.""" - deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"] = rest_field( - name="deploymentsMetadata", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the resource region. Required.""" + resource_id: str = rest_field(name="azureResourceId", visibility=["read"]) + """The Azure resource ID of the language or AI resource. Required.""" + region: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Azure resource region. Required.""" @overload def __init__( self, *, - deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"], + region: str, ) -> None: ... @overload @@ -97,33 +83,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignedProjectResource(_Model): - """Represents the assigned project resource. +class AssignedProjectDeploymentMetadata(_Model): + """Represents the metadata for an assigned deployment. - :ivar resource_id: The Azure resource ID of the language or AI resource. Required. - :vartype resource_id: str - :ivar region: The Azure resource region. Required. - :vartype region: str - :ivar assigned_aoai_resource: Represents the AOAI resource assigned for data generation. - :vartype assigned_aoai_resource: - ~azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo + :ivar deployment_name: Represents the deployment name. Required. + :vartype deployment_name: str + :ivar last_deployed_on: Represents deployment last deployed time. Required. + :vartype last_deployed_on: ~datetime.datetime + :ivar deployment_expires_on: Represents deployment expiration date in the runtime. Required. + :vartype deployment_expires_on: ~datetime.date """ - resource_id: str = rest_field(name="azureResourceId", visibility=["read"]) - """The Azure resource ID of the language or AI resource. Required.""" - region: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure resource region. Required.""" - assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = rest_field( - name="assignedAoaiResource", visibility=["read", "create", "update", "delete", "query"] + deployment_name: str = rest_field(name="deploymentName", visibility=["read", "create", "update", "delete", "query"]) + """Represents the deployment name. Required.""" + last_deployed_on: datetime.datetime = rest_field( + name="lastDeployedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) - """Represents the AOAI resource assigned for data generation.""" + """Represents deployment last deployed time. Required.""" + deployment_expires_on: datetime.date = rest_field( + name="deploymentExpirationDate", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents deployment expiration date in the runtime. Required.""" @overload def __init__( self, *, - region: str, - assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = None, + deployment_name: str, + last_deployed_on: datetime.datetime, + deployment_expires_on: datetime.date, ) -> None: ... @overload @@ -137,23 +125,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignProjectResourcesDetails(_Model): - """Represents the payload for assigning Azure resources to a project. +class AssignedProjectDeploymentsMetadata(_Model): + """Represents the metadata for assigned deployments for a project. - :ivar metadata: Represents the metadata for the project resources to be assigned. Required. - :vartype metadata: list[~azure.ai.language.conversations.authoring.models.ResourceMetadata] + :ivar project_name: Represents the project name. Required. + :vartype project_name: str + :ivar deployments_metadata: Represents the resource region. Required. + :vartype deployments_metadata: + list[~azure.ai.language.conversations.authoring.models.AssignedProjectDeploymentMetadata] """ - metadata: list["_models.ResourceMetadata"] = rest_field( - name="projectResources", visibility=["read", "create", "update", "delete", "query"] + project_name: str = rest_field(name="projectName", visibility=["read"]) + """Represents the project name. Required.""" + deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"] = rest_field( + name="deploymentsMetadata", visibility=["read", "create", "update", "delete", "query"] ) - """Represents the metadata for the project resources to be assigned. Required.""" + """Represents the resource region. Required.""" @overload def __init__( self, *, - metadata: list["_models.ResourceMetadata"], + deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"], ) -> None: ... @overload @@ -247,12 +240,12 @@ class ConversationExportedEntity(_Model): :vartype composition_mode: str or ~azure.ai.language.conversations.authoring.models.CompositionMode :ivar entities: The list component of the entity. - :vartype entities: ~azure.ai.language.conversations.authoring.models.ExportedEntityList + :vartype entities: ~azure.ai.language.conversations.authoring.models._models.ExportedEntityList :ivar prebuilts: The prebuilt entities components. :vartype prebuilts: - list[~azure.ai.language.conversations.authoring.models.ExportedPrebuiltEntity] + list[~azure.ai.language.conversations.authoring.models._models.ExportedPrebuiltEntity] :ivar regex: The regex component of the entity. - :vartype regex: ~azure.ai.language.conversations.authoring.models.ExportedEntityRegex + :vartype regex: ~azure.ai.language.conversations.authoring.models._models.ExportedEntityRegex :ivar required_components: The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. :vartype required_components: list[str] @@ -262,21 +255,21 @@ class ConversationExportedEntity(_Model): """The category of the entity. Required.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The entity description.""" - composition_mode: Optional[Union[str, "_models.CompositionMode"]] = rest_field( + composition_mode: Optional[Union[str, "_models._enums.CompositionMode"]] = rest_field( name="compositionSetting", visibility=["read", "create", "update", "delete", "query"] ) """The behavior to follow when the entity's components overlap with each other. Known values are: \"returnLongestOverlap\", \"requireExactOverlap\", \"separateComponents\", and \"combineComponents\".""" - entities: Optional["_models.ExportedEntityList"] = rest_field( + entities: Optional["_models._models.ExportedEntityList"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The list component of the entity.""" - prebuilts: Optional[list["_models.ExportedPrebuiltEntity"]] = rest_field( + prebuilts: Optional[list["_models._models.ExportedPrebuiltEntity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The prebuilt entities components.""" - regex: Optional["_models.ExportedEntityRegex"] = rest_field( + regex: Optional["_models._models.ExportedEntityRegex"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The regex component of the entity.""" @@ -291,10 +284,10 @@ def __init__( *, category: str, description: Optional[str] = None, - composition_mode: Optional[Union[str, "_models.CompositionMode"]] = None, - entities: Optional["_models.ExportedEntityList"] = None, - prebuilts: Optional[list["_models.ExportedPrebuiltEntity"]] = None, - regex: Optional["_models.ExportedEntityRegex"] = None, + composition_mode: Optional[Union[str, "_models._enums.CompositionMode"]] = None, + entities: Optional["_models._models.ExportedEntityList"] = None, + prebuilts: Optional[list["_models._models.ExportedPrebuiltEntity"]] = None, + regex: Optional["_models._models.ExportedEntityRegex"] = None, required_components: Optional[list[str]] = None, ) -> None: ... @@ -318,14 +311,14 @@ class ConversationExportedIntent(_Model): :vartype description: str :ivar associated_entities: The list of associated entities. :vartype associated_entities: - list[~azure.ai.language.conversations.authoring.models.ConversationExportedAssociatedEntityLabel] + list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedAssociatedEntityLabel] """ category: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The intent category. Required.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The intent description.""" - associated_entities: Optional[list["_models.ConversationExportedAssociatedEntityLabel"]] = rest_field( + associated_entities: Optional[list["_models._models.ConversationExportedAssociatedEntityLabel"]] = rest_field( name="associatedEntities", visibility=["read", "create", "update", "delete", "query"] ) """The list of associated entities.""" @@ -336,7 +329,7 @@ def __init__( *, category: str, description: Optional[str] = None, - associated_entities: Optional[list["_models.ConversationExportedAssociatedEntityLabel"]] = None, + associated_entities: Optional[list["_models._models.ConversationExportedAssociatedEntityLabel"]] = None, ) -> None: ... @overload @@ -391,27 +384,27 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv :ivar intents: The intents defined in the project. :vartype intents: - list[~azure.ai.language.conversations.authoring.models.ConversationExportedIntent] + list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedIntent] :ivar entities: The entities defined in the project. :vartype entities: - list[~azure.ai.language.conversations.authoring.models.ConversationExportedEntity] + list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedEntity] :ivar utterances: The utterances defined in the project. :vartype utterances: - list[~azure.ai.language.conversations.authoring.models.ConversationExportedUtterance] + list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedUtterance] :ivar project_kind: The type of project containing the assets. Required. A project to build natural language into apps, bots, and IoT devices. :vartype project_kind: str or ~azure.ai.language.conversations.authoring.models.CONVERSATION """ - intents: Optional[list["_models.ConversationExportedIntent"]] = rest_field( + intents: Optional[list["_models._models.ConversationExportedIntent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The intents defined in the project.""" - entities: Optional[list["_models.ConversationExportedEntity"]] = rest_field( + entities: Optional[list["_models._models.ConversationExportedEntity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The entities defined in the project.""" - utterances: Optional[list["_models.ConversationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models._models.ConversationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The utterances defined in the project.""" @@ -423,9 +416,9 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv def __init__( self, *, - intents: Optional[list["_models.ConversationExportedIntent"]] = None, - entities: Optional[list["_models.ConversationExportedEntity"]] = None, - utterances: Optional[list["_models.ConversationExportedUtterance"]] = None, + intents: Optional[list["_models._models.ConversationExportedIntent"]] = None, + entities: Optional[list["_models._models.ConversationExportedEntity"]] = None, + utterances: Optional[list["_models._models.ConversationExportedUtterance"]] = None, ) -> None: ... @overload @@ -445,7 +438,7 @@ class ConversationExportedUtterance(_Model): :ivar entities: Represents the entity labels of the utterance. :vartype entities: - list[~azure.ai.language.conversations.authoring.models.ExportedUtteranceEntityLabel] + list[~azure.ai.language.conversations.authoring.models._models.ExportedUtteranceEntityLabel] :ivar text: The utterance text. Required. :vartype text: str :ivar language: Represents the utterance's language. This is BCP-47 representation of a @@ -458,7 +451,7 @@ class ConversationExportedUtterance(_Model): :vartype dataset: str or ~azure.ai.language.conversations.authoring.models.DatasetType """ - entities: Optional[list["_models.ExportedUtteranceEntityLabel"]] = rest_field( + entities: Optional[list["_models._models.ExportedUtteranceEntityLabel"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the entity labels of the utterance.""" @@ -469,7 +462,7 @@ class ConversationExportedUtterance(_Model): use \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.""" intent: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The intent of the utterance. Required.""" - dataset: Optional[Union[str, "_models.DatasetType"]] = rest_field( + dataset: Optional[Union[str, "_models._enums.DatasetType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The dataset for this utterance. Allowed values are 'Train' and 'Test'. Known values are: @@ -481,9 +474,9 @@ def __init__( *, text: str, intent: str, - entities: Optional[list["_models.ExportedUtteranceEntityLabel"]] = None, + entities: Optional[list["_models._models.ExportedUtteranceEntityLabel"]] = None, language: Optional[str] = None, - dataset: Optional[Union[str, "_models.DatasetType"]] = None, + dataset: Optional[Union[str, "_models._enums.DatasetType"]] = None, ) -> None: ... @overload @@ -638,14 +631,14 @@ class CreateDeploymentDetails(_Model): provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. :vartype assigned_resources: - list[~azure.ai.language.conversations.authoring.models.DeploymentResource] + list[~azure.ai.language.conversations.authoring.models._models.DeploymentResource] """ trained_model_label: str = rest_field( name="trainedModelLabel", visibility=["read", "create", "update", "delete", "query"] ) """Represents the trained model label. Required.""" - assigned_resources: Optional[list["_models.DeploymentResource"]] = rest_field( + assigned_resources: Optional[list["_models._models.DeploymentResource"]] = rest_field( name="assignedResources", visibility=["read", "create", "update", "delete", "query"] ) """Represents the resources to be assigned to the deployment. If provided, the deployment will be @@ -657,7 +650,7 @@ def __init__( self, *, trained_model_label: str, - assigned_resources: Optional[list["_models.DeploymentResource"]] = None, + assigned_resources: Optional[list["_models._models.DeploymentResource"]] = None, ) -> None: ... @overload @@ -755,7 +748,7 @@ class DataGenerationConnectionInfo(_Model): :vartype resource_id: str """ - kind: Union[str, "_models.DataGenerationConnectionKind"] = rest_field( + kind: Union[str, "_models._enums.DataGenerationConnectionKind"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Connection type for data generation settings. Currently only supports Azure OpenAI. Required. @@ -772,7 +765,7 @@ class DataGenerationConnectionInfo(_Model): def __init__( self, *, - kind: Union[str, "_models.DataGenerationConnectionKind"], + kind: Union[str, "_models._enums.DataGenerationConnectionKind"], deployment_name: str, resource_id: Optional[str] = None, ) -> None: ... @@ -797,14 +790,14 @@ class DataGenerationSettings(_Model): :ivar data_generation_connection_info: Must be filled out to enable data generation to augment training data. Required. :vartype data_generation_connection_info: - ~azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo + ~azure.ai.language.conversations.authoring.models._models.DataGenerationConnectionInfo """ enable_data_generation: bool = rest_field( name="enableDataGeneration", visibility=["read", "create", "update", "delete", "query"] ) """Must be explicitly set to True to enable data generation to augment training data. Required.""" - data_generation_connection_info: "_models.DataGenerationConnectionInfo" = rest_field( + data_generation_connection_info: "_models._models.DataGenerationConnectionInfo" = rest_field( name="dataGenerationConnectionInfo", visibility=["read", "create", "update", "delete", "query"] ) """Must be filled out to enable data generation to augment training data. Required.""" @@ -814,7 +807,39 @@ def __init__( self, *, enable_data_generation: bool, - data_generation_connection_info: "_models.DataGenerationConnectionInfo", + data_generation_connection_info: "_models._models.DataGenerationConnectionInfo", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeleteDeploymentDetails(_Model): + """Represents the payload for deleting a project deployment. + + :ivar assigned_resource_ids: Represents the Language or AIService resource IDs to unassign from + the project or delete the deployment from. + :vartype assigned_resource_ids: list[str] + """ + + assigned_resource_ids: Optional[list[str]] = rest_field( + name="assignedResourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Language or AIService resource IDs to unassign from the project or delete the + deployment from.""" + + @overload + def __init__( + self, + *, + assigned_resource_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -904,14 +929,14 @@ class DeploymentResource(_Model): :vartype region: str :ivar assigned_aoai_resource: Represents the AOAI resource assigned for data generation. :vartype assigned_aoai_resource: - ~azure.ai.language.conversations.authoring.models.DataGenerationConnectionInfo + ~azure.ai.language.conversations.authoring.models._models.DataGenerationConnectionInfo """ resource_id: str = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"]) """Represents the Azure resource Id. Required.""" region: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Represents the resource region. Required.""" - assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = rest_field( + assigned_aoai_resource: Optional["_models._models.DataGenerationConnectionInfo"] = rest_field( name="assignedAoaiResource", visibility=["read", "create", "update", "delete", "query"] ) """Represents the AOAI resource assigned for data generation.""" @@ -922,7 +947,74 @@ def __init__( *, resource_id: str, region: str, - assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = None, + assigned_aoai_resource: Optional["_models._models.DataGenerationConnectionInfo"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeploymentResourcesState(_Model): + """Represents the state of a project resources job. + + :ivar job_id: The job ID. Required. + :vartype job_id: str + :ivar created_on: The creation date time of the job. Required. + :vartype created_on: ~datetime.datetime + :ivar last_updated_on: The last date time the job was updated. Required. + :vartype last_updated_on: ~datetime.datetime + :ivar expires_on: The expiration date time of the job. + :vartype expires_on: ~datetime.datetime + :ivar status: The job status. Required. Known values are: "notStarted", "running", "succeeded", + "failed", "cancelled", "cancelling", and "partiallyCompleted". + :vartype status: str or ~azure.ai.language.conversations.authoring.models.OperationStatus + :ivar warnings: The warnings that were encountered while executing the job. + :vartype warnings: list[~azure.core.ODataV4Format] + :ivar errors: The errors encountered while executing the job. + :vartype errors: list[~azure.core.ODataV4Format] + """ + + job_id: str = rest_field(name="jobId", visibility=["read"]) + """The job ID. Required.""" + created_on: datetime.datetime = rest_field( + name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The creation date time of the job. Required.""" + last_updated_on: datetime.datetime = rest_field( + name="lastUpdatedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The last date time the job was updated. Required.""" + expires_on: Optional[datetime.datetime] = rest_field( + name="expirationDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The expiration date time of the job.""" + status: Union[str, "_models.OperationStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The job status. Required. Known values are: \"notStarted\", \"running\", \"succeeded\", + \"failed\", \"cancelled\", \"cancelling\", and \"partiallyCompleted\".""" + warnings: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The warnings that were encountered while executing the job.""" + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The errors encountered while executing the job.""" + + @overload + def __init__( + self, + *, + created_on: datetime.datetime, + last_updated_on: datetime.datetime, + status: Union[str, "_models.OperationStatus"], + expires_on: Optional[datetime.datetime] = None, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -1317,7 +1409,7 @@ class EvaluationState(_Model): :ivar errors: The errors encountered while executing the job. :vartype errors: list[~azure.core.ODataV4Format] :ivar result: Represents evaluation task detailed result. Required. - :vartype result: ~azure.ai.language.conversations.authoring.models.EvaluationJobResult + :vartype result: ~azure.ai.language.conversations.authoring.models._models.EvaluationJobResult """ job_id: str = rest_field(name="jobId", visibility=["read"]) @@ -1343,7 +1435,9 @@ class EvaluationState(_Model): """The warnings that were encountered while executing the job.""" errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" - result: "_models.EvaluationJobResult" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + result: "_models._models.EvaluationJobResult" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Represents evaluation task detailed result. Required.""" @overload @@ -1353,7 +1447,7 @@ def __init__( created_on: datetime.datetime, last_updated_on: datetime.datetime, status: Union[str, "_models.OperationStatus"], - result: "_models.EvaluationJobResult", + result: "_models._models.EvaluationJobResult", expires_on: Optional[datetime.datetime] = None, warnings: Optional[list[ODataV4Format]] = None, errors: Optional[list[ODataV4Format]] = None, @@ -1445,13 +1539,13 @@ class ExportedConversationOrchestrationDetails(ExportedOrchestrationDetails, dis :ivar conversation_orchestration: The Conversational project target details. Required. :vartype conversation_orchestration: - ~azure.ai.language.conversations.authoring.models.ExportedConversationOrchestration + ~azure.ai.language.conversations.authoring.models._models.ExportedConversationOrchestration :ivar target_project_kind: The kind of the target used in the orchestration flow. Required. :vartype target_project_kind: str or ~azure.ai.language.conversations.authoring.models.CONVERSATION """ - conversation_orchestration: "_models.ExportedConversationOrchestration" = rest_field( + conversation_orchestration: "_models._models.ExportedConversationOrchestration" = rest_field( name="conversationOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The Conversational project target details. Required.""" @@ -1462,7 +1556,7 @@ class ExportedConversationOrchestrationDetails(ExportedOrchestrationDetails, dis def __init__( self, *, - conversation_orchestration: "_models.ExportedConversationOrchestration", + conversation_orchestration: "_models._models.ExportedConversationOrchestration", ) -> None: ... @overload @@ -1482,10 +1576,10 @@ class ExportedEntityList(_Model): :ivar sublists: The sub-lists of the list component. :vartype sublists: - list[~azure.ai.language.conversations.authoring.models.ExportedEntitySublist] + list[~azure.ai.language.conversations.authoring.models._models.ExportedEntitySublist] """ - sublists: Optional[list["_models.ExportedEntitySublist"]] = rest_field( + sublists: Optional[list["_models._models.ExportedEntitySublist"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The sub-lists of the list component.""" @@ -1494,7 +1588,7 @@ class ExportedEntityList(_Model): def __init__( self, *, - sublists: Optional[list["_models.ExportedEntitySublist"]] = None, + sublists: Optional[list["_models._models.ExportedEntitySublist"]] = None, ) -> None: ... @overload @@ -1553,10 +1647,10 @@ class ExportedEntityRegex(_Model): `https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions `_. :vartype expressions: - list[~azure.ai.language.conversations.authoring.models.ExportedEntityRegexExpression] + list[~azure.ai.language.conversations.authoring.models._models.ExportedEntityRegexExpression] """ - expressions: Optional[list["_models.ExportedEntityRegexExpression"]] = rest_field( + expressions: Optional[list["_models._models.ExportedEntityRegexExpression"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The regex expressions of the regex component. These expressions follow the .NET regex syntax. @@ -1568,7 +1662,7 @@ class ExportedEntityRegex(_Model): def __init__( self, *, - expressions: Optional[list["_models.ExportedEntityRegexExpression"]] = None, + expressions: Optional[list["_models._models.ExportedEntityRegexExpression"]] = None, ) -> None: ... @overload @@ -1635,12 +1729,12 @@ class ExportedEntitySublist(_Model): :vartype list_key: str :ivar synonyms: The phrases of that correspond to the sub-list. :vartype synonyms: - list[~azure.ai.language.conversations.authoring.models.ExportedEntityListSynonym] + list[~azure.ai.language.conversations.authoring.models._models.ExportedEntityListSynonym] """ list_key: Optional[str] = rest_field(name="listKey", visibility=["read", "create", "update", "delete", "query"]) """The key of the sub-list.""" - synonyms: Optional[list["_models.ExportedEntityListSynonym"]] = rest_field( + synonyms: Optional[list["_models._models.ExportedEntityListSynonym"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The phrases of that correspond to the sub-list.""" @@ -1650,7 +1744,7 @@ def __init__( self, *, list_key: Optional[str] = None, - synonyms: Optional[list["_models.ExportedEntityListSynonym"]] = None, + synonyms: Optional[list["_models._models.ExportedEntityListSynonym"]] = None, ) -> None: ... @overload @@ -1709,12 +1803,12 @@ class ExportedLuisOrchestrationDetails(ExportedOrchestrationDetails, discriminat :ivar luis_orchestration: The LUIS application target details. Required. :vartype luis_orchestration: - ~azure.ai.language.conversations.authoring.models.ExportedLuisOrchestration + ~azure.ai.language.conversations.authoring.models._models.ExportedLuisOrchestration :ivar target_project_kind: The kind of the target used in the orchestration flow. Required. :vartype target_project_kind: str or ~azure.ai.language.conversations.authoring.models.LUIS """ - luis_orchestration: "_models.ExportedLuisOrchestration" = rest_field( + luis_orchestration: "_models._models.ExportedLuisOrchestration" = rest_field( name="luisOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The LUIS application target details. Required.""" @@ -1725,7 +1819,7 @@ class ExportedLuisOrchestrationDetails(ExportedOrchestrationDetails, discriminat def __init__( self, *, - luis_orchestration: "_models.ExportedLuisOrchestration", + luis_orchestration: "_models._models.ExportedLuisOrchestration", ) -> None: ... @overload @@ -1879,7 +1973,7 @@ class ExportedProject(_Model): :ivar metadata: Represents the project metadata. Required. :vartype metadata: ~azure.ai.language.conversations.authoring.models.CreateProjectOptions :ivar assets: Represents the project assets. - :vartype assets: ~azure.ai.language.conversations.authoring.models.ExportedProjectAsset + :vartype assets: ~azure.ai.language.conversations.authoring.models._models.ExportedProjectAsset """ project_file_version: str = rest_field( @@ -1894,7 +1988,7 @@ class ExportedProject(_Model): Known values are: \"Utf16CodeUnit\", \"Utf8CodeUnit\", and \"Utf32CodeUnit\".""" metadata: "_models.CreateProjectOptions" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Represents the project metadata. Required.""" - assets: Optional["_models.ExportedProjectAsset"] = rest_field( + assets: Optional["_models._models.ExportedProjectAsset"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the project assets.""" @@ -1906,7 +2000,7 @@ def __init__( project_file_version: str, string_index_type: Union[str, "_models.StringIndexType"], metadata: "_models.CreateProjectOptions", - assets: Optional["_models.ExportedProjectAsset"] = None, + assets: Optional["_models._models.ExportedProjectAsset"] = None, ) -> None: ... @overload @@ -1955,13 +2049,13 @@ class ExportedQuestionAnsweringOrchestrationDetails( :ivar question_answering_orchestration: The Question Answering project details. Required. :vartype question_answering_orchestration: - ~azure.ai.language.conversations.authoring.models.ExportedQuestionAnsweringOrchestration + ~azure.ai.language.conversations.authoring.models._models.ExportedQuestionAnsweringOrchestration :ivar target_project_kind: The kind of the target used in the orchestration flow. Required. :vartype target_project_kind: str or ~azure.ai.language.conversations.authoring.models.QUESTION_ANSWERING """ - question_answering_orchestration: "_models.ExportedQuestionAnsweringOrchestration" = rest_field( + question_answering_orchestration: "_models._models.ExportedQuestionAnsweringOrchestration" = rest_field( name="questionAnsweringOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The Question Answering project details. Required.""" @@ -1972,7 +2066,7 @@ class ExportedQuestionAnsweringOrchestrationDetails( def __init__( self, *, - question_answering_orchestration: "_models.ExportedQuestionAnsweringOrchestration", + question_answering_orchestration: "_models._models.ExportedQuestionAnsweringOrchestration", ) -> None: ... @overload @@ -2444,14 +2538,14 @@ class OrchestrationExportedIntent(_Model): :ivar orchestration: Specifies the behavior of this intent in the orchestration flow. :vartype orchestration: - ~azure.ai.language.conversations.authoring.models.ExportedOrchestrationDetails + ~azure.ai.language.conversations.authoring.models._models.ExportedOrchestrationDetails :ivar category: The intent category. Required. :vartype category: str :ivar description: The intent description. :vartype description: str """ - orchestration: Optional["_models.ExportedOrchestrationDetails"] = rest_field( + orchestration: Optional["_models._models.ExportedOrchestrationDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Specifies the behavior of this intent in the orchestration flow.""" @@ -2465,7 +2559,7 @@ def __init__( self, *, category: str, - orchestration: Optional["_models.ExportedOrchestrationDetails"] = None, + orchestration: Optional["_models._models.ExportedOrchestrationDetails"] = None, description: Optional[str] = None, ) -> None: ... @@ -2485,21 +2579,21 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc :ivar intents: Represents the intents of the project. :vartype intents: - list[~azure.ai.language.conversations.authoring.models.OrchestrationExportedIntent] + list[~azure.ai.language.conversations.authoring.models._models.OrchestrationExportedIntent] :ivar utterances: Represents the utterances of the project. :vartype utterances: - list[~azure.ai.language.conversations.authoring.models.OrchestrationExportedUtterance] + list[~azure.ai.language.conversations.authoring.models._models.OrchestrationExportedUtterance] :ivar project_kind: The type of project containing the assets. Required. A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project. :vartype project_kind: str or ~azure.ai.language.conversations.authoring.models.ORCHESTRATION """ - intents: Optional[list["_models.OrchestrationExportedIntent"]] = rest_field( + intents: Optional[list["_models._models.OrchestrationExportedIntent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the intents of the project.""" - utterances: Optional[list["_models.OrchestrationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the utterances of the project.""" @@ -2511,8 +2605,8 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc def __init__( self, *, - intents: Optional[list["_models.OrchestrationExportedIntent"]] = None, - utterances: Optional[list["_models.OrchestrationExportedUtterance"]] = None, + intents: Optional[list["_models._models.OrchestrationExportedIntent"]] = None, + utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = None, ) -> None: ... @overload @@ -2693,7 +2787,7 @@ class ProjectDeployment(_Model): :vartype model_training_config_version: str :ivar assigned_resources: Represents the metadata of the assigned Azure resources. Required. :vartype assigned_resources: - list[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] + list[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] """ deployment_name: str = rest_field(name="deploymentName", visibility=["read"]) @@ -2716,7 +2810,7 @@ class ProjectDeployment(_Model): name="modelTrainingConfigVersion", visibility=["read", "create", "update", "delete", "query"] ) """Represents model training config version. Required.""" - assigned_resources: list["_models.AssignedProjectResource"] = rest_field( + assigned_resources: list["_models.AssignedDeploymentResource"] = rest_field( name="assignedResources", visibility=["read", "create", "update", "delete", "query"] ) """Represents the metadata of the assigned Azure resources. Required.""" @@ -2730,7 +2824,7 @@ def __init__( last_deployed_on: datetime.datetime, deployment_expired_on: datetime.date, model_training_config_version: str, - assigned_resources: list["_models.AssignedProjectResource"], + assigned_resources: list["_models.AssignedDeploymentResource"], ) -> None: ... @overload @@ -2837,105 +2931,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProjectResourceIds(_Model): - """Represents the payload for deleting a project deployment. - - :ivar azure_resource_ids: Represents the Language or AIService resource IDs to unassign from - the project or delete the deployment from. - :vartype azure_resource_ids: list[str] - """ - - azure_resource_ids: Optional[list[str]] = rest_field( - name="azureResourceIds", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the Language or AIService resource IDs to unassign from the project or delete the - deployment from.""" - - @overload - def __init__( - self, - *, - azure_resource_ids: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ProjectResourcesState(_Model): - """Represents the state of a project resources job. - - :ivar job_id: The job ID. Required. - :vartype job_id: str - :ivar created_on: The creation date time of the job. Required. - :vartype created_on: ~datetime.datetime - :ivar last_updated_on: The last date time the job was updated. Required. - :vartype last_updated_on: ~datetime.datetime - :ivar expires_on: The expiration date time of the job. - :vartype expires_on: ~datetime.datetime - :ivar status: The job status. Required. Known values are: "notStarted", "running", "succeeded", - "failed", "cancelled", "cancelling", and "partiallyCompleted". - :vartype status: str or ~azure.ai.language.conversations.authoring.models.OperationStatus - :ivar warnings: The warnings that were encountered while executing the job. - :vartype warnings: list[~azure.core.ODataV4Format] - :ivar errors: The errors encountered while executing the job. - :vartype errors: list[~azure.core.ODataV4Format] - """ - - job_id: str = rest_field(name="jobId", visibility=["read"]) - """The job ID. Required.""" - created_on: datetime.datetime = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The creation date time of the job. Required.""" - last_updated_on: datetime.datetime = rest_field( - name="lastUpdatedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The last date time the job was updated. Required.""" - expires_on: Optional[datetime.datetime] = rest_field( - name="expirationDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The expiration date time of the job.""" - status: Union[str, "_models.OperationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The job status. Required. Known values are: \"notStarted\", \"running\", \"succeeded\", - \"failed\", \"cancelled\", \"cancelling\", and \"partiallyCompleted\".""" - warnings: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The warnings that were encountered while executing the job.""" - errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The errors encountered while executing the job.""" - - @overload - def __init__( - self, - *, - created_on: datetime.datetime, - last_updated_on: datetime.datetime, - status: Union[str, "_models.OperationStatus"], - expires_on: Optional[datetime.datetime] = None, - warnings: Optional[list[ODataV4Format]] = None, - errors: Optional[list[ODataV4Format]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ProjectSettings(_Model): """Represents the settings used to define the project behavior. @@ -3321,7 +3316,7 @@ class TrainingJobDetails(_Model): :ivar data_generation_settings: For customers to populate if they wish to use data generation for their model training job. :vartype data_generation_settings: - ~azure.ai.language.conversations.authoring.models.DataGenerationSettings + ~azure.ai.language.conversations.authoring.models._models.DataGenerationSettings """ model_label: str = rest_field(name="modelLabel", visibility=["read", "create", "update", "delete", "query"]) @@ -3341,7 +3336,7 @@ class TrainingJobDetails(_Model): ) """Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20.""" - data_generation_settings: Optional["_models.DataGenerationSettings"] = rest_field( + data_generation_settings: Optional["_models._models.DataGenerationSettings"] = rest_field( name="dataGenerationSettings", visibility=["read", "create", "update", "delete", "query"] ) """For customers to populate if they wish to use data generation for their model training job.""" @@ -3354,7 +3349,7 @@ def __init__( training_mode: Union[str, "_models.TrainingMode"], training_config_version: Optional[str] = None, evaluation_options: Optional["_models.EvaluationDetails"] = None, - data_generation_settings: Optional["_models.DataGenerationSettings"] = None, + data_generation_settings: Optional["_models._models.DataGenerationSettings"] = None, ) -> None: ... @overload diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_patch.py index 0772ff2eeb67..87676c65a8f0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_patch.py @@ -1,379 +1,21 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- """Customize generated code here. + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from collections.abc import MutableMapping, Awaitable # pylint:disable=import-error -from typing import Any, Callable, Optional, Tuple, TypeVar, cast - -import base64 -import functools -import time - -from azure.core.exceptions import ResourceNotFoundError -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncPollingMethod, PollingMethod -from azure.core.polling.base_polling import ( - BadResponse, - LongRunningOperation, - OperationFailed, -) -from azure.core.rest import HttpRequest - -from ._enums import ExportedProjectFormat -from ._models import ( - CopyProjectDetails, - CopyProjectState, - ConversationExportedEntity, - ConversationExportedIntent, - ConversationExportedProjectAsset, - ConversationExportedUtterance, - CreateDeploymentDetails, - DeploymentDeleteFromResourcesState, - DeploymentState, - EvaluationJobResult, - EvaluationState, - ExportProjectState, - ExportedModelDetails, - ExportedModelState, - ExportedProject, - ExportedUtteranceEntityLabel, - ImportProjectState, - LoadSnapshotState, - ProjectDeletionState, - ResourceMetadata, - SwapDeploymentsDetails, - SwapDeploymentsState, - TrainingJobDetails, -) - -JSON = MutableMapping[str, Any] -T = TypeVar("T") - - -class _JobsStrategy(LongRunningOperation): - """Interprets job-status responses and tells the poller which URL to use.""" - - def __init__(self, async_url: str): - self._async_url = async_url - - # We can poll if we have an operation-location URL - def can_poll(self, pipeline_response: PipelineResponse) -> bool: # noqa: D401 - return bool(self._async_url) - - # Always poll the jobs URL from operation-location - def get_polling_url(self) -> str: # noqa: D401 - return self._async_url - - # Initial status after the first call (202→InProgress, 200 could be immediate success) - def set_initial_status(self, pipeline_response: PipelineResponse) -> str: # noqa: D401 - sc = pipeline_response.http_response.status_code - if sc in (200, 201): - return "InProgress" # job hasn’t finished yet; service will report status on poll - if sc in (202, 204): - return "InProgress" - raise OperationFailed("Operation failed or canceled") - - # Map service statuses to core strings - def get_status(self, pipeline_response: JSON) -> str: # type: ignore - raw = str(pipeline_response.get("status", "")).lower() - if raw in ("succeeded",): - return "Succeeded" - if raw in ("failed",): - return "Failed" - if raw in ("cancelled", "canceled"): - return "Canceled" - # notstarted, running, cancelling, partiallycompleted → still in progress - return "InProgress" - - # Force the final GET to also come from operation-location (or return None to use last body) - def get_final_get_url(self, pipeline_response: PipelineResponse) -> Optional[str]: # noqa: D401 - return self._async_url - - -class _JobsPollingMethod(PollingMethod): - def __init__(self, polling_interval: float = 30.0, *, path_format_arguments: Optional[dict] = None, **kwargs: Any): - self._polling_interval = polling_interval - self._kwargs = kwargs - self._path_format_arguments = path_format_arguments or {} - - # predeclare attributes to satisfy pylint W0201 - self._client: Any = None - self._initial_response: Optional[PipelineResponse] = None - self._deserialization_callback: Optional[Callable] = None - self._resource: Optional[PipelineResponse] = None - self._status: str = "NotStarted" - self._operation: Any = None # or a concrete type if available - self._command: Optional[Callable[[], PipelineResponse]] = None - - # ---- LRO lifecycle ---- - def initialize(self, client: Any, initial_response: PipelineResponse, deserialization_callback: Callable) -> None: - self._client = client - self._initial_response = initial_response - self._deserialization_callback = deserialization_callback - self._resource = None - self._status = "InProgress" - - # Extract operation-location (case-insensitive) - headers = initial_response.http_response.headers - op_loc = headers.get("Operation-Location") or headers.get("operation-location") - if not op_loc: - raise BadResponse("Missing Operation-Location header for job polling") - - # Resolve {Endpoint} etc. - if self._path_format_arguments: - op_loc = self._client.format_url(op_loc, **self._path_format_arguments) - - # Strategy: always use jobs URL - self._operation = _JobsStrategy(op_loc) - if not self._operation.can_poll(initial_response): - raise BadResponse("Cannot poll: no jobs URL") - - # Command to GET status from jobs URL - self._command = functools.partial(self._do_get, self._operation.get_polling_url()) - - # Initial status - self._status = self._operation.set_initial_status(initial_response) - - def run(self) -> None: - while not self.finished(): - self.update_status() - if not self.finished(): - time.sleep(self._polling_interval) - - # Final GET (via jobs URL) if strategy asks for it - final_url = self._operation.get_final_get_url(self._initial_response) - if final_url: - self._resource = self._do_get(final_url) - - def finished(self) -> bool: - return self._status in ("Succeeded", "Failed", "Canceled") - - def status(self) -> str: - return self._status - - def resource(self) -> Any: - if self._deserialization_callback is None or self._initial_response is None: - raise RuntimeError("Polling method not initialized; call initialize() first.") - # Return typed object using provided callback (expects PipelineResponse) - return self._deserialization_callback(self._resource or self._initial_response) - - def update_status(self) -> None: - if self._command is None: - raise RuntimeError("Polling method not initialized; call initialize() first.") - - try: - self._resource = self._command() - except ResourceNotFoundError: - # Treat as transient if your service uses 404-before-ready semantics - self._resource = None - - body: JSON = {} - if self._resource is not None: - try: - body = cast(JSON, self._resource.http_response.json()) - except Exception as exc: - raise BadResponse("Polling response is not JSON") from exc - self._status = self._operation.get_status(body) - # ---- Helpers ---- - def _do_get(self, url: str) -> PipelineResponse: - # REST pipeline path (new core) - if hasattr(self._client, "send_request"): - req = HttpRequest("GET", url) - return cast( - PipelineResponse, self._client.send_request(req, _return_pipeline_response=True, **self._kwargs) - ) - # Legacy pipeline fallback - request = self._client.get(url) - return cast( - PipelineResponse, - self._client._pipeline.run(request, stream=False, **self._kwargs), # pylint: disable=protected-access - ) - # ---- Continuation token support (doc pattern) ---- - def get_continuation_token(self) -> str: - import pickle - - return base64.b64encode(pickle.dumps(self._initial_response)).decode("ascii") - - @classmethod - def from_continuation_token(cls, continuation_token: str, **kwargs: Any) -> Tuple[Any, PipelineResponse, Callable]: - import pickle - - client = kwargs["client"] - deserialization_callback = kwargs["deserialization_callback"] - initial_response = pickle.loads(base64.b64decode(continuation_token)) # nosec - return client, initial_response, deserialization_callback - - -class _AsyncJobsPollingMethod(AsyncPollingMethod): - def __init__( - self, - polling_interval: float = 30.0, - *, - path_format_arguments: Optional[dict] = None, - **kwargs: Any, - ): - self._polling_interval = polling_interval - self._kwargs = kwargs - self._path_format_arguments = path_format_arguments or {} - - # Predeclare all attributes to satisfy pylint W0201 - self._client: Any = None - self._initial_response: Optional[PipelineResponse] = None - self._deserialization_callback: Optional[Callable] = None - self._resource: Optional[PipelineResponse] = None - self._status: str = "NotStarted" - self._operation: Any = None - self._command: Optional[Callable[[], Awaitable[PipelineResponse]]] = None - - # ---- LRO lifecycle ---- - def initialize(self, client: Any, initial_response: PipelineResponse, deserialization_callback: Callable) -> None: - self._client = client - self._initial_response = initial_response - self._deserialization_callback = deserialization_callback - self._resource = None # no type annotation here - self._status = "InProgress" # no type annotation here - - # Operation-Location (case-insensitive) - headers = initial_response.http_response.headers - op_loc = headers.get("Operation-Location") or headers.get("operation-location") - if not op_loc: - raise BadResponse("Missing Operation-Location header for job polling") - - if self._path_format_arguments: - op_loc = self._client.format_url(op_loc, **self._path_format_arguments) - - self._operation = _JobsStrategy(op_loc) - if not self._operation.can_poll(initial_response): - raise BadResponse("Cannot poll: no jobs URL") - - # async GET command bound to jobs URL - self._command = functools.partial(self._do_get_async, self._operation.get_polling_url()) - - # Seed initial status from first response - self._status = self._operation.set_initial_status(initial_response) - - async def run(self) -> None: - while not self.finished(): - await self.update_status() - if not self.finished(): - await self._sleep(self._polling_interval) - - final_url = self._operation.get_final_get_url(self._initial_response) - if final_url: - self._resource = await self._do_get_async(final_url) - - async def _sleep(self, seconds: float) -> None: - # Prefer the Azure Core transport's sleep (fast/no-op in playback) - transport = getattr(self._client, "_transport", None) or getattr( - getattr(self._client, "_pipeline", None), "_transport", None - ) - if transport and hasattr(transport, "sleep"): - await transport.sleep(seconds) - return - # Fallback for non-Azure transports (allowed per rule text) - import asyncio # pylint: disable=import-outside-toplevel, do-not-import-asyncio - - await asyncio.sleep(seconds) - - def finished(self) -> bool: - return self._status in ("Succeeded", "Failed", "Canceled") - - def status(self) -> str: - return self._status - - def resource(self) -> Any: - if self._deserialization_callback is None or self._initial_response is None: - raise RuntimeError("Polling method not initialized; call initialize() first.") - return self._deserialization_callback(self._resource or self._initial_response) - - async def update_status(self) -> None: - if self._command is None: - raise RuntimeError("Polling method not initialized; call initialize() first.") - - try: - self._resource = await self._command() - except ResourceNotFoundError: - self._resource = None - - body: dict = {} - if self._resource is not None: - try: - body = cast(dict, self._resource.http_response.json()) - except Exception as exc: # be explicit so pylint sees the chain - raise BadResponse("Polling response is not JSON") from exc - self._status = self._operation.get_status(body) - - # ---- Helpers ---- - async def _do_get_async(self, url: str) -> PipelineResponse: - # New core: async pipeline client has async send_request - if hasattr(self._client, "send_request"): - req = HttpRequest("GET", url) - return cast( - PipelineResponse, - await self._client.send_request(req, _return_pipeline_response=True, **self._kwargs), - ) - # Legacy fallback (unlikely in modern azure-core) - request = self._client.get(url) - return cast( - PipelineResponse, - await self._client._pipeline.run(request, stream=False, **self._kwargs), # pylint: disable=protected-access - ) - - # ---- Continuation token ---- - def get_continuation_token(self) -> str: - import pickle - - return base64.b64encode(pickle.dumps(self._initial_response)).decode("ascii") - - @classmethod - def from_continuation_token(cls, continuation_token: str, **kwargs: Any) -> Tuple[Any, PipelineResponse, Callable]: - import pickle - - client = kwargs["client"] - deserialization_callback = kwargs["deserialization_callback"] - initial_response = pickle.loads(base64.b64decode(continuation_token)) # nosec - return client, initial_response, deserialization_callback +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): """Do not remove from this file. + `patch_sdk` is a last resort escape hatch that allows you to do customizations you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = [ - "SwapDeploymentsDetails", - "CopyProjectState", - "ExportProjectState", - "SwapDeploymentsState", - "CreateDeploymentDetails", - "DeploymentDeleteFromResourcesState", - "DeploymentState", - "ExportedModelDetails", - "ExportedModelState", - "LoadSnapshotState", - "ProjectDeletionState", - "ExportedProjectFormat", - "ExportedProject", - "ImportProjectState", - "CopyProjectDetails", - "TrainingJobDetails", - "CopyProjectDetails", - "EvaluationJobResult", - "EvaluationState", - "ConversationExportedProjectAsset", - "ConversationExportedIntent", - "ConversationExportedEntity", - "ConversationExportedUtterance", - "ExportedUtteranceEntityLabel", - "ResourceMetadata", -] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_operations.py index c6bb26044905..fd8cab17d697 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_operations.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from collections.abc import MutableMapping # pylint:disable=import-error +from collections.abc import MutableMapping from io import IOBase import json from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload @@ -561,7 +561,7 @@ def build_project_list_training_jobs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_list_project_resources_request( # pylint: disable=name-too-long +def build_project_list_deployment_resources_request( # pylint: disable=name-too-long project_name: str, *, top: Optional[int] = None, @@ -672,7 +672,7 @@ def build_project_list_exported_models_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_assign_project_resources_request( # pylint: disable=name-too-long +def build_project_assign_deployment_resources_request( # pylint: disable=name-too-long project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +698,7 @@ def build_project_assign_project_resources_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_unassign_project_resources_request( # pylint: disable=name-too-long +def build_project_unassign_deployment_resources_request( # pylint: disable=name-too-long project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -724,7 +724,7 @@ def build_project_unassign_project_resources_request( # pylint: disable=name-to return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_get_assign_project_resources_status_request( # pylint: disable=name-too-long +def build_project_get_assign_deployment_resources_status_request( # pylint: disable=name-too-long job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -751,7 +751,7 @@ def build_project_get_assign_project_resources_status_request( # pylint: disabl return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_get_unassign_project_resources_status_request( # pylint: disable=name-too-long +def build_project_get_unassign_deployment_resources_status_request( # pylint: disable=name-too-long job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -882,7 +882,7 @@ def build_project_get_project_deletion_status_request( # pylint: disable=name-t def build_project_import_method_request( project_name: str, *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -914,7 +914,7 @@ def build_project_export_request( project_name: str, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -2202,7 +2202,7 @@ def _delete_project_initial(self, project_name: str, **kwargs: Any) -> Iterator[ return deserialized # type: ignore @distributed_trace - def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[None]: + def _begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[None]: """Deletes a project. :param project_name: The name of the project to use. Required. @@ -2251,7 +2251,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ExportProjectState: + def _get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models._models.ExportProjectState: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. :param project_name: The new project name. Required. @@ -2259,7 +2259,7 @@ def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2273,7 +2273,7 @@ def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_export_status_request( project_name=project_name, @@ -2306,7 +2306,9 @@ def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ExportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2314,7 +2316,7 @@ def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m return deserialized # type: ignore @distributed_trace - def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ImportProjectState: + def _get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models._models.ImportProjectState: """Gets the status for an import. :param project_name: The new project name. Required. @@ -2322,7 +2324,7 @@ def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m :param job_id: The job ID. Required. :type job_id: str :return: ImportProjectState. The ImportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ImportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ImportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2336,7 +2338,7 @@ def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ImportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ImportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_import_status_request( project_name=project_name, @@ -2369,7 +2371,9 @@ def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _m if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ImportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ImportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2458,7 +2462,7 @@ def get_deployment(self, deployment_name: str, **kwargs: Any) -> _models.Project return deserialized # type: ignore def _deploy_project_initial( - self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2521,67 +2525,26 @@ def _deploy_project_initial( return deserialized # type: ignore @overload - def begin_deploy_project( + def _begin_deploy_project( self, deployment_name: str, - body: _models.CreateDeploymentDetails, + body: _models._models.CreateDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_deploy_project( + def _begin_deploy_project( self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_deploy_project( + def _begin_deploy_project( self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new deployment or replaces an existing one. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The new deployment info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace - def begin_deploy_project( - self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_deploy_project( + self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Creates a new deployment or replaces an existing one. @@ -2589,8 +2552,8 @@ def begin_deploy_project( :type deployment_name: str :param body: The new deployment info. Is one of the following types: CreateDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails or JSON - or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.CreateDeploymentDetails + or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2693,7 +2656,7 @@ def _delete_deployment_initial(self, deployment_name: str, **kwargs: Any) -> Ite return deserialized # type: ignore @distributed_trace - def begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]: + def _begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]: """Deletes a project deployment. :param deployment_name: The name of the specific deployment of the project to use. Required. @@ -2747,7 +2710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long - self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2810,69 +2773,22 @@ def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long return deserialized # type: ignore @overload - def begin_delete_deployment_from_resources( + def _begin_delete_deployment_from_resources( self, deployment_name: str, - body: _models.ProjectResourceIds, + body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_delete_deployment_from_resources( + def _begin_delete_deployment_from_resources( self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_delete_deployment_from_resources( + def _begin_delete_deployment_from_resources( self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a deployment from the specified project-assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The Language or AIService resource list for deleting the deployment.\\r\\n - The deployment will only be deleted from the specified resources, and will remain for the rest. - Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( @@ -2880,8 +2796,8 @@ def begin_delete_deployment_from_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "deployment_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def begin_delete_deployment_from_resources( - self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + def _begin_delete_deployment_from_resources( + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -2889,9 +2805,9 @@ def begin_delete_deployment_from_resources( :type deployment_name: str :param body: The Language or AIService resource list for deleting the deployment.\\r\\n The deployment will only be deleted from the specified resources, and will remain for the rest. - Is one of the following types: ProjectResourceIds, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or - IO[bytes] + Is one of the following types: DeleteDeploymentDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails + or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2948,9 +2864,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "deployment_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def get_deployment_delete_from_resources_status( # pylint: disable=name-too-long + def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-long self, deployment_name: str, job_id: str, **kwargs: Any - ) -> _models.DeploymentDeleteFromResourcesState: + ) -> _models._models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. :param deployment_name: Represents deployment name. Required. @@ -2959,7 +2875,8 @@ def get_deployment_delete_from_resources_status( # pylint: disable=name-too-lon :type job_id: str :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState + :rtype: + ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2973,7 +2890,7 @@ def get_deployment_delete_from_resources_status( # pylint: disable=name-too-lon _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( deployment_name=deployment_name, @@ -3007,7 +2924,9 @@ def get_deployment_delete_from_resources_status( # pylint: disable=name-too-lon if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentDeleteFromResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentDeleteFromResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3015,7 +2934,9 @@ def get_deployment_delete_from_resources_status( # pylint: disable=name-too-lon return deserialized # type: ignore @distributed_trace - def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any) -> _models.DeploymentState: + def _get_deployment_status( + self, deployment_name: str, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentState: """Gets the status of an existing deployment job. :param deployment_name: Represents deployment name. Required. @@ -3023,7 +2944,7 @@ def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any :param job_id: The job ID. Required. :type job_id: str :return: DeploymentState. The DeploymentState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentState + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3037,7 +2958,7 @@ def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( deployment_name=deployment_name, @@ -3071,7 +2992,9 @@ def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3292,25 +3215,25 @@ def get_next(next_link=None): params_added_on={"2025-11-01": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def list_project_resources( + def list_deployment_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.AssignedProjectResource"]: + ) -> ItemPaged["_models.AssignedDeploymentResource"]: """Lists the Language or AIService resources assigned to the project. :keyword top: The number of result items to return. Default value is None. :paramtype top: int :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int - :return: An iterator like instance of AssignedProjectResource + :return: An iterator like instance of AssignedDeploymentResource :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] + ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[list[_models.AssignedProjectResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3323,7 +3246,7 @@ def list_project_resources( def prepare_request(next_link=None): if not next_link: - _request = build_project_list_project_resources_request( + _request = build_project_list_deployment_resources_request( project_name=self._config.project_name, top=top, skip=skip, @@ -3363,7 +3286,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(list[_models.AssignedProjectResource], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedDeploymentResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3583,8 +3506,8 @@ def get_next(next_link=None): params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def _assign_project_resources_initial( - self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any + def _assign_deployment_resources_initial( + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3607,7 +3530,7 @@ def _assign_project_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_assign_project_resources_request( + _request = build_project_assign_deployment_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -3646,64 +3569,21 @@ def _assign_project_resources_initial( return deserialized # type: ignore @overload - def begin_assign_project_resources( - self, body: _models.AssignProjectResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + def _begin_assign_deployment_resources( + self, + body: _models._models.AssignDeploymentResourcesDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... @overload - def begin_assign_project_resources( + def _begin_assign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_assign_project_resources( + def _begin_assign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Language or AIService Azure resources to a project to allowing deployment 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 body: The new project resources to be assigned. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( @@ -3711,8 +3591,8 @@ def begin_assign_project_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def begin_assign_project_resources( - self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_assign_deployment_resources( + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. This API is available only via AAD authentication and not supported via subscription key @@ -3721,8 +3601,9 @@ def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Is one of the following types: - AssignProjectResourcesDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails or + AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. + :type body: + ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] @@ -3737,7 +3618,7 @@ def begin_assign_project_resources( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._assign_project_resources_initial( + raw_result = self._assign_deployment_resources_initial( body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore @@ -3773,8 +3654,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def _unassign_project_resources_initial( - self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + def _unassign_deployment_resources_initial( + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3797,7 +3678,7 @@ def _unassign_project_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_unassign_project_resources_request( + _request = build_project_unassign_deployment_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -3836,52 +3717,17 @@ def _unassign_project_resources_initial( return deserialized # type: ignore @overload - def begin_unassign_project_resources( - self, body: _models.ProjectResourceIds, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + def _begin_unassign_deployment_resources( + self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: ... @overload - def begin_unassign_project_resources( + def _begin_unassign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_unassign_project_resources( + def _begin_unassign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deployment to these resources. - - :param body: The list of Language or AIService Azure resource IDs to be unassigned. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( @@ -3889,15 +3735,15 @@ def begin_unassign_project_resources( params_added_on={"2025-11-01": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def begin_unassign_project_resources( - self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any + def _begin_unassign_deployment_resources( + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. :param body: The list of Language or AIService Azure resource IDs to be unassigned. Is one of - the following types: ProjectResourceIds, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or - IO[bytes] + the following types: DeleteDeploymentDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails + or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3911,7 +3757,7 @@ def begin_unassign_project_resources( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._unassign_project_resources_initial( + raw_result = self._unassign_deployment_resources_initial( body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore @@ -3948,13 +3794,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-11-01": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: + def _get_assign_deployment_resources_status( + self, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState + :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with + MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3968,9 +3817,9 @@ def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_assign_project_resources_status_request( + _request = build_project_get_assign_deployment_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -4001,7 +3850,9 @@ def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4014,13 +3865,16 @@ def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _mo params_added_on={"2025-11-01": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) - def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: + def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long + self, job_id: str, **kwargs: Any + ) -> _models._models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState + :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with + MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4034,9 +3888,9 @@ def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_unassign_project_resources_status_request( + _request = build_project_get_unassign_deployment_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -4067,7 +3921,9 @@ def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectResourcesState, response.json()) + deserialized = _deserialize( + _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4075,7 +3931,7 @@ def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _ return deserialized # type: ignore def _swap_deployments_initial( - self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4137,63 +3993,28 @@ def _swap_deployments_initial( return deserialized # type: ignore @overload - def begin_swap_deployments( - self, body: _models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + def _begin_swap_deployments( + self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: ... @overload - def begin_swap_deployments( + def _begin_swap_deployments( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_swap_deployments( + def _begin_swap_deployments( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Swaps two existing deployments with each other. - - :param body: The job object to swap two deployments. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace - def begin_swap_deployments( - self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_swap_deployments( + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Swaps two existing deployments with each other. :param body: The job object to swap two deployments. Is one of the following types: SwapDeploymentsDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.SwapDeploymentsDetails or + JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -4239,13 +4060,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models.SwapDeploymentsState: + def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models._models.SwapDeploymentsState: """Gets the status of an existing swap deployment job. :param job_id: The job ID. Required. :type job_id: str :return: SwapDeploymentsState. The SwapDeploymentsState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsState + :rtype: ~azure.ai.language.conversations.authoring.models._models.SwapDeploymentsState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4259,7 +4080,7 @@ def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models.Swa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SwapDeploymentsState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( job_id=job_id, @@ -4292,7 +4113,9 @@ def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models.Swa if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.SwapDeploymentsState, response.json()) + deserialized = _deserialize( + _models._models.SwapDeploymentsState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4300,7 +4123,7 @@ def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models.Swa return deserialized # type: ignore @distributed_trace - def get_project(self, **kwargs: Any) -> _models.ProjectDetails: + def _get_project(self, **kwargs: Any) -> _models.ProjectDetails: """Gets the details of a project. :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping @@ -4358,13 +4181,13 @@ def get_project(self, **kwargs: Any) -> _models.ProjectDetails: return deserialized # type: ignore @distributed_trace - def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models.ProjectDeletionState: + def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._models.ProjectDeletionState: """Gets the status for a project deletion job. :param job_id: The job ID. Required. :type job_id: str :return: ProjectDeletionState. The ProjectDeletionState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeletionState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ProjectDeletionState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4378,7 +4201,7 @@ def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models.Pro _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectDeletionState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ProjectDeletionState] = kwargs.pop("cls", None) _request = build_project_get_project_deletion_status_request( job_id=job_id, @@ -4410,7 +4233,9 @@ def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models.Pro if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ProjectDeletionState, response.json()) + deserialized = _deserialize( + _models._models.ProjectDeletionState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4419,9 +4244,9 @@ def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models.Pro def _import_method_initial( self, - body: Union[_models.ExportedProject, JSON, IO[bytes]], + body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4485,89 +4310,39 @@ def _import_method_initial( return deserialized # type: ignore @overload - def begin_import( + def _begin_import_method( self, - body: _models.ExportedProject, + body: _models._models.ExportedProject, *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedProject - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_import( + def _begin_import_method( self, body: JSON, *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: JSON - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_import( + def _begin_import_method( self, body: IO[bytes], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Triggers a job to import a project. If a project with the same name already exists, the data of - that project is replaced. - - :param body: The project data to import. Required. - :type body: IO[bytes] - :keyword exported_project_format: The format of the exported project file to use. Known values - are: "Conversation" and "Luis". Default value is None. - :paramtype exported_project_format: str or - ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace - def begin_import( + def _begin_import_method( self, - body: Union[_models.ExportedProject, JSON, IO[bytes]], + body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, **kwargs: Any ) -> LROPoller[None]: """Triggers a job to import a project. If a project with the same name already exists, the data of @@ -4575,8 +4350,8 @@ def begin_import( :param body: The project data to import. Is one of the following types: ExportedProject, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedProject or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.ExportedProject or JSON + or IO[bytes] :keyword exported_project_format: The format of the exported project file to use. Known values are: "Conversation" and "Luis". Default value is None. :paramtype exported_project_format: str or @@ -4635,7 +4410,7 @@ def _export_initial( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -4694,11 +4469,11 @@ def _export_initial( return deserialized # type: ignore @distributed_trace - def begin_export( + def _begin_export( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -4771,13 +4546,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportProjectState: + def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._models.ExportProjectState: """Gets the status of an export job. Once job completes, returns the project metadata, and assets. :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4791,7 +4566,7 @@ def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportProject _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( job_id=job_id, @@ -4824,7 +4599,9 @@ def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportProject if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportProjectState, response.json()) + deserialized = _deserialize( + _models._models.ExportProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4832,7 +4609,7 @@ def get_export_status(self, job_id: str, **kwargs: Any) -> _models.ExportProject return deserialized # type: ignore @overload - def copy_project_authorization( + def _copy_project_authorization( self, *, project_kind: Union[str, _models.ProjectKind], @@ -4840,57 +4617,15 @@ def copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :keyword project_kind: Represents the project kind. Known values are: "Conversation", - "Orchestration", and "CustomConversationSummarization". Required. - :paramtype project_kind: str or ~azure.ai.language.conversations.authoring.models.ProjectKind - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword storage_input_container_name: The name of the storage container. Default value is - None. - :paramtype storage_input_container_name: str - :keyword allow_overwrite: Whether to allow an existing project to be overwritten using the - resulting copy authorization. Default value is None. - :paramtype allow_overwrite: bool - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> _models._models.CopyProjectDetails: ... @overload - def copy_project_authorization( + def _copy_project_authorization( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> _models._models.CopyProjectDetails: ... @overload - def copy_project_authorization( + def _copy_project_authorization( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CopyProjectDetails: - """Generates a copy project operation authorization to the current target Azure resource. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> _models._models.CopyProjectDetails: ... @distributed_trace @api_version_validation( @@ -4898,7 +4633,7 @@ def copy_project_authorization( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "content_type", "accept"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def copy_project_authorization( + def _copy_project_authorization( self, body: Union[JSON, IO[bytes]] = _Unset, *, @@ -4906,7 +4641,7 @@ def copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models.CopyProjectDetails: + ) -> _models._models.CopyProjectDetails: """Generates a copy project operation authorization to the current target Azure resource. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -4921,7 +4656,7 @@ def copy_project_authorization( resulting copy authorization. Default value is None. :paramtype allow_overwrite: bool :return: CopyProjectDetails. The CopyProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails + :rtype: ~azure.ai.language.conversations.authoring.models._models.CopyProjectDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4936,7 +4671,7 @@ def copy_project_authorization( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CopyProjectDetails] = kwargs.pop("cls", None) + cls: ClsType[_models._models.CopyProjectDetails] = kwargs.pop("cls", None) if body is _Unset: if project_kind is _Unset: @@ -4986,7 +4721,9 @@ def copy_project_authorization( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.CopyProjectDetails, response.json()) + deserialized = _deserialize( + _models._models.CopyProjectDetails, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4999,7 +4736,7 @@ def copy_project_authorization( api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def _copy_project_initial( - self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5061,52 +4798,17 @@ def _copy_project_initial( return deserialized # type: ignore @overload - def begin_copy_project( - self, body: _models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + def _begin_copy_project( + self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: ... @overload - def begin_copy_project( + def _begin_copy_project( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_copy_project( + def _begin_copy_project( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Copies an existing project to another Azure resource. - - :param body: The copy project info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( @@ -5114,15 +4816,15 @@ def begin_copy_project( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def begin_copy_project( - self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_copy_project( + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Copies an existing project to another Azure resource. :param body: The copy project info. Is one of the following types: CopyProjectDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.CopyProjectDetails or + JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -5173,13 +4875,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={"2025-05-15-preview": ["api_version", "project_name", "job_id", "accept"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.CopyProjectState: + def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models._models.CopyProjectState: """Gets the status of an existing copy project job. :param job_id: The job ID. Required. :type job_id: str :return: CopyProjectState. The CopyProjectState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectState + :rtype: ~azure.ai.language.conversations.authoring.models._models.CopyProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5193,7 +4895,7 @@ def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.CopyPro _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.CopyProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( job_id=job_id, @@ -5226,7 +4928,9 @@ def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.CopyPro if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.CopyProjectState, response.json()) + deserialized = _deserialize( + _models._models.CopyProjectState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5234,7 +4938,7 @@ def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models.CopyPro return deserialized # type: ignore def _train_initial( - self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5296,69 +5000,28 @@ def _train_initial( return deserialized # type: ignore @overload - def begin_train( - self, body: _models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + def _begin_train( + self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.TrainingJobResult]: ... @overload - def begin_train( + def _begin_train( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[_models.TrainingJobResult]: ... @overload - def begin_train( + def _begin_train( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[_models.TrainingJobResult]: ... @distributed_trace - def begin_train( - self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_train( + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.TrainingJobResult]: """Triggers a training job for a project. :param body: The training input parameters. Is one of the following types: TrainingJobDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.TrainingJobDetails or + JSON or IO[bytes] :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is compatible with MutableMapping :rtype: @@ -5416,7 +5079,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def get_training_status(self, job_id: str, **kwargs: Any) -> _models.TrainingState: + def _get_training_status(self, job_id: str, **kwargs: Any) -> _models.TrainingState: """Gets the status for a training job. :param job_id: The job ID. Required. @@ -5736,7 +5399,7 @@ def _delete_exported_model_initial(self, exported_model_name: str, **kwargs: Any params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def begin_delete_exported_model(self, exported_model_name: str, **kwargs: Any) -> LROPoller[None]: + def _begin_delete_exported_model(self, exported_model_name: str, **kwargs: Any) -> LROPoller[None]: """Deletes an existing exported model. :param exported_model_name: The exported model name. Required. @@ -5794,7 +5457,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def _create_or_update_exported_model_initial( - self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any + self, + exported_model_name: str, + body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5857,63 +5523,22 @@ def _create_or_update_exported_model_initial( return deserialized # type: ignore @overload - def begin_create_or_update_exported_model( + def _begin_create_or_update_exported_model( self, exported_model_name: str, - body: _models.ExportedModelDetails, + body: _models._models.ExportedModelDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_create_or_update_exported_model( + def _begin_create_or_update_exported_model( self, exported_model_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[None]: ... @overload - def begin_create_or_update_exported_model( + def _begin_create_or_update_exported_model( self, exported_model_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Creates a new exported model or replaces an existing one. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :param body: The exported model info. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( @@ -5921,8 +5546,11 @@ def begin_create_or_update_exported_model( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def begin_create_or_update_exported_model( - self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any + def _begin_create_or_update_exported_model( + self, + exported_model_name: str, + body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], + **kwargs: Any ) -> LROPoller[None]: """Creates a new exported model or replaces an existing one. @@ -5930,8 +5558,8 @@ def begin_create_or_update_exported_model( :type exported_model_name: str :param body: The exported model info. Is one of the following types: ExportedModelDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails or JSON or - IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models._models.ExportedModelDetails or + JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -5990,9 +5618,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- }, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def get_exported_model_job_status( + def _get_exported_model_job_status( self, exported_model_name: str, job_id: str, **kwargs: Any - ) -> _models.ExportedModelState: + ) -> _models._models.ExportedModelState: """Gets the status for an existing job to create or update an exported model. :param exported_model_name: The exported model name. Required. @@ -6000,7 +5628,7 @@ def get_exported_model_job_status( :param job_id: The job ID. Required. :type job_id: str :return: ExportedModelState. The ExportedModelState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportedModelState + :rtype: ~azure.ai.language.conversations.authoring.models._models.ExportedModelState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6014,7 +5642,7 @@ def get_exported_model_job_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ExportedModelState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( exported_model_name=exported_model_name, @@ -6048,7 +5676,9 @@ def get_exported_model_job_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.ExportedModelState, response.json()) + deserialized = _deserialize( + _models._models.ExportedModelState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6256,69 +5886,22 @@ def _evaluate_model_initial( return deserialized # type: ignore @overload - def begin_evaluate_model( + def _begin_evaluate_model( self, trained_model_label: str, body: _models.EvaluationDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: ~azure.ai.language.conversations.authoring.models.EvaluationDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EvaluationJobResult. The EvaluationJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[_models._models.EvaluationJobResult]: ... @overload - def begin_evaluate_model( + def _begin_evaluate_model( self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EvaluationJobResult. The EvaluationJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> LROPoller[_models._models.EvaluationJobResult]: ... @overload - def begin_evaluate_model( + def _begin_evaluate_model( self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EvaluationJobResult]: - """Triggers evaluation operation on a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :param body: The training input parameters. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns EvaluationJobResult. The EvaluationJobResult is - compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> LROPoller[_models._models.EvaluationJobResult]: ... @distributed_trace @api_version_validation( @@ -6326,9 +5909,9 @@ def begin_evaluate_model( params_added_on={"2025-05-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def begin_evaluate_model( + def _begin_evaluate_model( self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.EvaluationJobResult]: + ) -> LROPoller[_models._models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. :param trained_model_label: The trained model label. Required. @@ -6340,14 +5923,14 @@ def begin_evaluate_model( :return: An instance of LROPoller that returns EvaluationJobResult. The EvaluationJobResult is compatible with MutableMapping :rtype: - ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.EvaluationJobResult] + ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models._models.EvaluationJobResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_models._models.EvaluationJobResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -6371,7 +5954,10 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize(_models.EvaluationJobResult, response.json().get("result", {})) + deserialized = _deserialize( + _models._models.EvaluationJobResult, # pylint: disable=protected-access + response.json().get("result", {}), + ) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -6389,13 +5975,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.EvaluationJobResult].from_continuation_token( + return LROPoller[_models._models.EvaluationJobResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.EvaluationJobResult]( + return LROPoller[_models._models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -6451,7 +6037,7 @@ def _load_snapshot_initial(self, trained_model_label: str, **kwargs: Any) -> Ite return deserialized # type: ignore @distributed_trace - def begin_load_snapshot(self, trained_model_label: str, **kwargs: Any) -> LROPoller[None]: + def _begin_load_snapshot(self, trained_model_label: str, **kwargs: Any) -> LROPoller[None]: """Restores the snapshot of this trained model to be the current working directory of the project. :param trained_model_label: The trained model label. Required. @@ -6511,7 +6097,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- }, api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def get_evaluation_status(self, trained_model_label: str, job_id: str, **kwargs: Any) -> _models.EvaluationState: + def _get_evaluation_status( + self, trained_model_label: str, job_id: str, **kwargs: Any + ) -> _models._models.EvaluationState: """Gets the status for an evaluation job. :param trained_model_label: The trained model label. Required. @@ -6519,7 +6107,7 @@ def get_evaluation_status(self, trained_model_label: str, job_id: str, **kwargs: :param job_id: The job ID. Required. :type job_id: str :return: EvaluationState. The EvaluationState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.EvaluationState + :rtype: ~azure.ai.language.conversations.authoring.models._models.EvaluationState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6533,7 +6121,7 @@ def get_evaluation_status(self, trained_model_label: str, job_id: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( trained_model_label=trained_model_label, @@ -6567,7 +6155,9 @@ def get_evaluation_status(self, trained_model_label: str, job_id: str, **kwargs: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationState, response.json()) + deserialized = _deserialize( + _models._models.EvaluationState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6748,9 +6338,9 @@ def get_model_evaluation_summary(self, trained_model_label: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace - def get_load_snapshot_status( + def _get_load_snapshot_status( self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> _models.LoadSnapshotState: + ) -> _models._models.LoadSnapshotState: """Gets the status for loading a snapshot. :param trained_model_label: The trained model label. Required. @@ -6758,7 +6348,7 @@ def get_load_snapshot_status( :param job_id: The job ID. Required. :type job_id: str :return: LoadSnapshotState. The LoadSnapshotState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.LoadSnapshotState + :rtype: ~azure.ai.language.conversations.authoring.models._models.LoadSnapshotState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6772,7 +6362,7 @@ def get_load_snapshot_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LoadSnapshotState] = kwargs.pop("cls", None) + cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( trained_model_label=trained_model_label, @@ -6806,7 +6396,9 @@ def get_load_snapshot_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.LoadSnapshotState, response.json()) + deserialized = _deserialize( + _models._models.LoadSnapshotState, response.json() # pylint: disable=protected-access + ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_patch.py index d16191ea330a..87676c65a8f0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_patch.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_patch.py @@ -1,21 +1,21 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- """Customize generated code here. + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from ._project_op_patch import ProjectOperations + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): """Do not remove from this file. + `patch_sdk` is a last resort escape hatch that allows you to do customizations you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ProjectOperations"] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py deleted file mode 100644 index 8945d2652d62..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py +++ /dev/null @@ -1,110 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from collections.abc import MutableMapping # pylint:disable=import-error -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from .._utils.model_base import _deserialize -from ..models._patch import _JobsPollingMethod -from ..models import TrainingJobResult -from ._operations import ProjectOperations as ProjectOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -_Unset: Any = object() -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - - -class ProjectOperations(ProjectOperationsGenerated): - - @distributed_trace - def begin_cancel_training_job( # pylint: disable=function-redefined - self, job_id: str, **kwargs: Any - ) -> LROPoller[TrainingJobResult]: - """ - Cancel a training job without requiring project_name explicitly. - - :param job_id: The identifier of the training job to cancel. Required. - :type job_id: str - :return: An instance of LROPoller that returns TrainingJobResult. - :rtype: ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[TrainingJobResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - - if cont_token is None: - # 1) Send initial cancel request; keep PipelineResponse for the poller - initial = self._cancel_training_job_initial( - job_id=job_id, - cls=lambda x, y, z: x, # return PipelineResponse unchanged - headers=_headers, - params=_params, - **kwargs, - ) - initial.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - # 2) Deserializer: extract nested "result" as TrainingJobResult - def get_long_running_output(pipeline_response): - body = pipeline_response.http_response.json() or {} - result_dict = body.get("result", {}) or {} - obj = _deserialize(TrainingJobResult, result_dict) - if cls: - return cls(pipeline_response, obj, {}) # type: ignore - return obj - - # 3) Resolve {Endpoint} in Operation-Location for your poller - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - # 4) Choose polling method: your JobsPollingMethod by default - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, - _JobsPollingMethod( - polling_interval=lro_delay, - path_format_arguments=path_format_arguments, - # any extra kwargs your poller needs - ), - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - - # 5) Continuation-token path - if cont_token: - return LROPoller[TrainingJobResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - - # 6) Return the poller - return LROPoller[TrainingJobResult]( - self._client, - initial, # type: ignore - get_long_running_output, - polling_method, # type: ignore - ) - # return super()._begin_cancel_training_job( - # project_name=self._project_name, job_id=job_id, **kwargs - # ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py new file mode 100644 index 000000000000..64b796531561 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_cancel_training_job.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.begin_cancel_training_job( + job_id="8ccf2ffe-e758-4d04-a44a-31512918c7e8_637858368000000000", + ).result() + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulCancelTrainingJob.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py new file mode 100644 index 000000000000..434c4ce3b770 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_create_project.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.create_project( + project_name="myproject", + body={ + "description": "This is a sample conversation project.", + "language": "en", + "multilingual": False, + "projectKind": "Conversation", + "projectName": "myproject", + }, + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulCreateProject.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py new file mode 100644 index 000000000000..47fe1222936d --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_delete_model.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + client.trained_model.delete_trained_model( + trained_model_label="model2", + ) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulDeleteModel.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py new file mode 100644 index 000000000000..393173b40f95 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_deployment.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.deployment.get_deployment( + deployment_name="staging", + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetDeployment.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py new file mode 100644 index 000000000000..e6531a51798b --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_exported_model.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.exported_model.get_exported_model( + exported_model_name="exported-model1", + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetExportedModel.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py new file mode 100644 index 000000000000..4e23af22bf50 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_model.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.trained_model.get_trained_model( + trained_model_label="model1", + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetModel.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py new file mode 100644 index 000000000000..74e1c9063e96 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_model_evaluation.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.trained_model.get_model_evaluation_results( + trained_model_label="model1", + string_index_type="Utf16CodeUnit", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetModelEvaluation.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py new file mode 100644 index 000000000000..cc084290e391 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py @@ -0,0 +1,35 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_model_evaluation_summary.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.trained_model.get_model_evaluation_summary( + trained_model_label="model1", + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetModelEvaluationSummary.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py new file mode 100644 index 000000000000..933c778cafdb --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_project.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.get_project( + project_name="myproject", + ) + print(response) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetProject.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py new file mode 100644 index 000000000000..5bf717f0b238 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_supported_languages.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.list_supported_languages( + project_kind="Conversation", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetSupportedLanguages.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py new file mode 100644 index 000000000000..15d1e93ec000 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py @@ -0,0 +1,33 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_supported_prebuilt_entities.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.list_supported_prebuilt_entities() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetSupportedPrebuiltEntities.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py new file mode 100644 index 000000000000..1f6380d34231 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py @@ -0,0 +1,35 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_get_supported_training_config_versions.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.list_training_config_versions( + project_kind="Conversation", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulGetSupportedTrainingConfigVersions.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py new file mode 100644 index 000000000000..ec7f0cc0a3aa --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py @@ -0,0 +1,33 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_assigned_resource_deployments.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.list_assigned_resource_deployments() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListAssignedResourceDeployments.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py new file mode 100644 index 000000000000..9e92bb86abf9 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_deployments.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.list_deployments() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListDeployments.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py new file mode 100644 index 000000000000..4bee465500da --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_exported_models.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.list_exported_models() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListExportedModels.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py new file mode 100644 index 000000000000..bfc6a3c51207 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_models.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.list_trained_models() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListModels.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py new file mode 100644 index 000000000000..8c47b3751596 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_project_resources.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.list_deployment_resources() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListProjectResources.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py new file mode 100644 index 000000000000..90e73d9e0edc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_projects.py +""" + + +def main(): + client = ConversationAuthoringClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + ) + + response = client.list_projects() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListProjects.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py new file mode 100644 index 000000000000..d7f22d96e4cc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.ai.language.conversations.authoring import ConversationAuthoringProjectClient + +""" +# PREREQUISITES + pip install azure-ai-language-conversations-authoring +# USAGE + python successful_list_training_jobs.py +""" + + +def main(): + client = ConversationAuthoringProjectClient( + endpoint="{Endpoint}", + credential="CREDENTIAL", + project_name="PROJECT_NAME", + ) + + response = client.project.list_training_jobs() + for item in response: + print(item) + + +# x-ms-original-file: 2025-11-15-preview/examples/analyzeconversations-authoring/SuccessfulListTrainingJobs.json +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py new file mode 100644 index 000000000000..8253891081c6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + conversationauthoring_subscription_id = os.environ.get( + "CONVERSATIONAUTHORING_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoring_tenant_id = os.environ.get( + "CONVERSATIONAUTHORING_TENANT_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoring_client_id = os.environ.get( + "CONVERSATIONAUTHORING_CLIENT_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoring_client_secret = os.environ.get( + "CONVERSATIONAUTHORING_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=conversationauthoring_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=conversationauthoring_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=conversationauthoring_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=conversationauthoring_client_secret, value="00000000-0000-0000-0000-000000000000") + + conversationauthoringproject_subscription_id = os.environ.get( + "CONVERSATIONAUTHORINGPROJECT_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoringproject_tenant_id = os.environ.get( + "CONVERSATIONAUTHORINGPROJECT_TENANT_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoringproject_client_id = os.environ.get( + "CONVERSATIONAUTHORINGPROJECT_CLIENT_ID", "00000000-0000-0000-0000-000000000000" + ) + conversationauthoringproject_client_secret = os.environ.get( + "CONVERSATIONAUTHORINGPROJECT_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=conversationauthoringproject_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=conversationauthoringproject_tenant_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=conversationauthoringproject_client_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=conversationauthoringproject_client_secret, value="00000000-0000-0000-0000-000000000000" + ) + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py new file mode 100644 index 000000000000..d15fa71b9b76 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ConversationAuthoringClientTestBase, ConversationAuthoringPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoring(ConversationAuthoringClientTestBase): + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_list_projects(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.list_projects() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_list_supported_languages(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.list_supported_languages( + project_kind="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_list_assigned_resource_deployments(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.list_assigned_resource_deployments() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_list_supported_prebuilt_entities(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.list_supported_prebuilt_entities() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_list_training_config_versions(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.list_training_config_versions( + project_kind="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_create_project(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.create_project( + project_name="str", + body={ + "language": "str", + "projectKind": "str", + "projectName": "str", + "description": "str", + "multilingual": bool, + "settings": {"confidenceThreshold": 0.0}, + "storageInputContainerName": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy + def test_get_project(self, conversationauthoring_endpoint): + client = self.create_client(endpoint=conversationauthoring_endpoint) + response = client.get_project( + project_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py new file mode 100644 index 000000000000..d3a2ba2fe254 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ConversationAuthoringPreparer +from testpreparer_async import ConversationAuthoringClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringAsync(ConversationAuthoringClientTestBaseAsync): + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_list_projects(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = client.list_projects() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_list_supported_languages(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = client.list_supported_languages( + project_kind="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_list_assigned_resource_deployments(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = client.list_assigned_resource_deployments() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_list_supported_prebuilt_entities(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = client.list_supported_prebuilt_entities() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_list_training_config_versions(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = client.list_training_config_versions( + project_kind="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_create_project(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = await client.create_project( + project_name="str", + body={ + "language": "str", + "projectKind": "str", + "projectName": "str", + "description": "str", + "multilingual": bool, + "settings": {"confidenceThreshold": 0.0}, + "storageInputContainerName": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringPreparer() + @recorded_by_proxy_async + async def test_get_project(self, conversationauthoring_endpoint): + client = self.create_async_client(endpoint=conversationauthoring_endpoint) + response = await client.get_project( + project_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py new file mode 100644 index 000000000000..ae9a2624f56c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ConversationAuthoringProjectClientTestBase, ConversationAuthoringProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectDeploymentOperations(ConversationAuthoringProjectClientTestBase): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_deployment_get_deployment(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.deployment.get_deployment( + deployment_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py new file mode 100644 index 000000000000..0a9beabdd667 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ConversationAuthoringProjectPreparer +from testpreparer_async import ConversationAuthoringProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectDeploymentOperationsAsync(ConversationAuthoringProjectClientTestBaseAsync): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_deployment_get_deployment(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await client.deployment.get_deployment( + deployment_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py new file mode 100644 index 000000000000..9c78511492a8 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ConversationAuthoringProjectClientTestBase, ConversationAuthoringProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectExportedModelOperations(ConversationAuthoringProjectClientTestBase): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_exported_model_get_exported_model(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.exported_model.get_exported_model( + exported_model_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py new file mode 100644 index 000000000000..235c6d63fccc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ConversationAuthoringProjectPreparer +from testpreparer_async import ConversationAuthoringProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectExportedModelOperationsAsync(ConversationAuthoringProjectClientTestBaseAsync): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_exported_model_get_exported_model(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await client.exported_model.get_exported_model( + exported_model_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py new file mode 100644 index 000000000000..53ad7487f073 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ConversationAuthoringProjectClientTestBase, ConversationAuthoringProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectProjectOperations(ConversationAuthoringProjectClientTestBase): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_list_trained_models(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_trained_models() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_list_training_jobs(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_training_jobs() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_list_deployment_resources(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_deployment_resources() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_list_deployments(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_deployments() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_list_exported_models(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_exported_models() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_project_begin_cancel_training_job(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.begin_cancel_training_job( + job_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py new file mode 100644 index 000000000000..044b716282e4 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ConversationAuthoringProjectPreparer +from testpreparer_async import ConversationAuthoringProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectProjectOperationsAsync(ConversationAuthoringProjectClientTestBaseAsync): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_list_trained_models(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_trained_models() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_list_training_jobs(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_training_jobs() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_list_deployment_resources(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_deployment_resources() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_list_deployments(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_deployments() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_list_exported_models(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.project.list_exported_models() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_project_begin_cancel_training_job(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await ( + await client.project.begin_cancel_training_job( + job_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py new file mode 100644 index 000000000000..454412910ebc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ConversationAuthoringProjectClientTestBase, ConversationAuthoringProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectTrainedModelOperations(ConversationAuthoringProjectClientTestBase): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_trained_model_get_trained_model(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.trained_model.get_trained_model( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_trained_model_delete_trained_model(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.trained_model.delete_trained_model( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_trained_model_get_model_evaluation_results(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.trained_model.get_model_evaluation_results( + trained_model_label="str", + string_index_type="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy + def test_trained_model_get_model_evaluation_summary(self, conversationauthoringproject_endpoint): + client = self.create_client(endpoint=conversationauthoringproject_endpoint) + response = client.trained_model.get_model_evaluation_summary( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py new file mode 100644 index 000000000000..8cde0e938802 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ConversationAuthoringProjectPreparer +from testpreparer_async import ConversationAuthoringProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestConversationAuthoringProjectTrainedModelOperationsAsync(ConversationAuthoringProjectClientTestBaseAsync): + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_trained_model_get_trained_model(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await client.trained_model.get_trained_model( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_trained_model_delete_trained_model(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await client.trained_model.delete_trained_model( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_trained_model_get_model_evaluation_results(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = client.trained_model.get_model_evaluation_results( + trained_model_label="str", + string_index_type="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @ConversationAuthoringProjectPreparer() + @recorded_by_proxy_async + async def test_trained_model_get_model_evaluation_summary(self, conversationauthoringproject_endpoint): + client = self.create_async_client(endpoint=conversationauthoringproject_endpoint) + response = await client.trained_model.get_model_evaluation_summary( + trained_model_label="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py new file mode 100644 index 000000000000..7b37dc00dccd --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.ai.language.conversations.authoring import ConversationAuthoringClient, ConversationAuthoringProjectClient +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools + + +class ConversationAuthoringClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(ConversationAuthoringClient) + return self.create_client_from_credential( + ConversationAuthoringClient, + credential=credential, + endpoint=endpoint, + ) + + +ConversationAuthoringPreparer = functools.partial( + PowerShellPreparer, + "conversationauthoring", + conversationauthoring_endpoint="https://fake_conversationauthoring_endpoint.com", +) + + +class ConversationAuthoringProjectClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(ConversationAuthoringProjectClient) + return self.create_client_from_credential( + ConversationAuthoringProjectClient, + credential=credential, + endpoint=endpoint, + ) + + +ConversationAuthoringProjectPreparer = functools.partial( + PowerShellPreparer, + "conversationauthoringproject", + conversationauthoringproject_endpoint="https://fake_conversationauthoringproject_endpoint.com", +) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py new file mode 100644 index 000000000000..35cae060b9ed --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.ai.language.conversations.authoring.aio import ( + ConversationAuthoringClient, + ConversationAuthoringProjectClient, +) +from devtools_testutils import AzureRecordedTestCase + + +class ConversationAuthoringClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(ConversationAuthoringClient, is_async=True) + return self.create_client_from_credential( + ConversationAuthoringClient, + credential=credential, + endpoint=endpoint, + ) + + +class ConversationAuthoringProjectClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(ConversationAuthoringProjectClient, is_async=True) + return self.create_client_from_credential( + ConversationAuthoringProjectClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml index 8f1d414b7cc9..22839969f4e2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring -commit: 220549c6a9ec23f681e4e3eda90189beacb7937b +commit: 2fc7fcc9a50bcea5b3dd9307b80f09c440e385bb repo: Azure/azure-rest-api-specs additionalDirectories: