From 5f06ca1ebd3b58e36eb9e9c618dfbf20d1980467 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 10 Nov 2025 07:16:53 +0000 Subject: [PATCH 01/17] Configurations: 'specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring/tspconfig.yaml', API Version: 2025-11-15-preview, SDK Release Type: beta, and CommitSHA: 'd8f039ebd965e40471a082c547b103dd5dc9a33b' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5552628 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../_metadata.json | 6 +- .../apiview-properties.json | 5 +- .../conversations/authoring/_client.py | 12 +- .../conversations/authoring/_configuration.py | 8 +- .../conversations/authoring/_patch.py | 166 +--- .../authoring/_utils/model_base.py | 60 +- .../authoring/_utils/serialization.py | 26 +- .../conversations/authoring/aio/_client.py | 12 +- .../authoring/aio/_configuration.py | 8 +- .../conversations/authoring/aio/_patch.py | 162 +--- .../aio/operations/_deployment_op_patch.py | 276 ------ .../operations/_exported_model_op_patch.py | 177 ---- .../authoring/aio/operations/_operations.py | 742 +++++--------- .../authoring/aio/operations/_patch.py | 11 +- .../aio/operations/_project_op_patch.py | 913 ----------------- .../aio/operations/_trained_model_op_patch.py | 288 ------ .../authoring/models/__init__.py | 6 - .../conversations/authoring/models/_models.py | 296 +++--- .../conversations/authoring/models/_patch.py | 371 +------ .../operations/_deployment_op_patch.py | 266 ----- .../operations/_exported_model_op_patch.py | 173 ---- .../authoring/operations/_operations.py | 882 ++++++----------- .../authoring/operations/_patch.py | 11 +- .../authoring/operations/_project_op_patch.py | 918 ------------------ .../operations/_trained_model_op_patch.py | 287 ------ .../successful_cancel_training_job.py | 34 + .../successful_create_project.py | 40 + .../successful_delete_model.py | 33 + .../successful_get_deployment.py | 34 + .../successful_get_exported_model.py | 34 + .../successful_get_model.py | 34 + .../successful_get_model_evaluation.py | 36 + ...successful_get_model_evaluation_summary.py | 35 + .../successful_get_project.py | 33 + .../successful_get_supported_languages.py | 34 + ...cessful_get_supported_prebuilt_entities.py | 33 + ..._get_supported_training_config_versions.py | 35 + ...sful_list_assigned_resource_deployments.py | 33 + .../successful_list_deployments.py | 33 + .../successful_list_exported_models.py | 33 + .../successful_list_models.py | 33 + .../successful_list_project_resources.py | 33 + .../successful_list_projects.py | 32 + .../successful_list_training_jobs.py | 33 + .../generated_tests/conftest.py | 70 ++ .../test_conversation_authoring.py | 93 ++ .../test_conversation_authoring_async.py | 94 ++ ...authoring_project_deployment_operations.py | 24 + ...ing_project_deployment_operations_async.py | 25 + ...oring_project_exported_model_operations.py | 24 + ...project_exported_model_operations_async.py | 25 + ...on_authoring_project_project_operations.py | 69 ++ ...horing_project_project_operations_async.py | 72 ++ ...horing_project_trained_model_operations.py | 58 ++ ..._project_trained_model_operations_async.py | 59 ++ .../generated_tests/testpreparer.py | 46 + .../generated_tests/testpreparer_async.py | 34 + .../pyproject.toml | 44 +- ...ample_assign_deployment_resources_async.py | 2 + .../async/sample_cancel_training_job_async.py | 2 + .../async/sample_create_project_async.py | 3 + .../async/sample_delete_deployment_async.py | 6 +- .../async/sample_delete_project_async.py | 2 + .../sample_delete_trained_model_async.py | 2 + .../async/sample_deploy_project_async.py | 2 + .../async/sample_export_project_async.py | 2 + .../async/sample_get_deployment_async.py | 2 + ...mple_get_model_evaluation_results_async.py | 2 + ...mple_get_model_evaluation_summary_async.py | 10 +- .../samples/async/sample_get_project_async.py | 2 + .../async/sample_import_project_async.py | 2 + .../async/sample_load_snapshot_async.py | 2 + .../async/sample_swap_deployments_async.py | 2 + .../samples/async/sample_train_async.py | 2 + ...ple_unassign_deployment_resources_async.py | 3 + .../sample_assign_deployment_resources.py | 1 + .../samples/sample_cancel_training_job.py | 5 +- .../samples/sample_create_project.py | 1 + .../samples/sample_delete_deployment.py | 5 +- .../samples/sample_delete_project.py | 1 + .../samples/sample_delete_trained_model.py | 1 + .../samples/sample_deploy_project.py | 2 + .../samples/sample_export_project.py | 1 + .../samples/sample_get_deployment.py | 1 + .../sample_get_model_evaluation_results.py | 1 + .../sample_get_model_evaluation_summary.py | 11 +- .../samples/sample_get_project.py | 1 + .../samples/sample_import_project.py | 1 + .../samples/sample_load_snapshot.py | 1 + .../samples/sample_swap_deployments.py | 1 + .../samples/sample_train.py | 1 + .../sample_unassign_deployment_resources.py | 1 + .../sdk_packaging.toml | 2 - .../tests/test_cancel_training_job.py | 6 +- .../tests/test_cancel_training_job_async.py | 4 +- .../tests/test_delete_deployment.py | 6 +- .../tests/test_delete_deployment_async.py | 4 +- .../tests/test_delete_project.py | 2 +- .../tests/test_export_project.py | 1 + .../test_get_model_evaluation_summary.py | 2 +- .../tests/test_swap_deployments.py | 4 +- .../tsp-location.yaml | 4 +- 102 files changed, 2211 insertions(+), 5372 deletions(-) delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_deployment_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_exported_model_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_trained_model_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_deployment_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_exported_model_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_trained_model_op_patch.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/sdk_packaging.toml diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json index 253921f335be..6b454632cfc2 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-05-15-preview" + "apiVersion": "2025-11-15-preview", + "commit": "d8f039ebd965e40471a082c547b103dd5dc9a33b", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring", + "emitterVersion": "0.53.1" } \ 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 928a1a27ef3b..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,14 +1,12 @@ { "CrossLanguagePackageId": "Language.Conversations.Authoring", "CrossLanguageDefinitionId": { - "azure.ai.language.conversations.authoring.models.AssignedDeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringAssignedDeploymentResource", + "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.ConfusionMatrixCell": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixCell", "azure.ai.language.conversations.authoring.models.ConfusionMatrixRow": "Language.Conversations.Authoring.AnalyzeConversationAuthoringConfusionMatrixRow", "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.DeploymentResource": "Language.Conversations.Authoring.AnalyzeConversationAuthoringDeploymentResource", "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", @@ -32,7 +30,6 @@ "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.StringIndexType": "Language.Conversations.Authoring.StringIndexType", "azure.ai.language.conversations.authoring.models.EvaluationKind": "Language.Conversations.Authoring.EvaluationKind", 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 df30f7302ba1..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 @@ -40,7 +40,7 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -132,7 +132,7 @@ class ConversationAuthoringProjectClient: :param project_name: Required. :type project_name: str :keyword 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 + "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 @@ -169,10 +169,10 @@ def __init__( self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long + self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize) + self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize) + self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize) + self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_configuration.py index 46a2a0ab56ee..ce35f7820738 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_configuration.py @@ -31,13 +31,13 @@ class ConversationAuthoringClientConfiguration: # pylint: disable=too-many-inst :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2025-05-15-preview") + api_version: str = kwargs.pop("api_version", "2025-11-15-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -89,7 +89,7 @@ class ConversationAuthoringProjectClientConfiguration: # pylint: disable=too-ma :param project_name: Required. :type project_name: str :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -97,7 +97,7 @@ class ConversationAuthoringProjectClientConfiguration: # pylint: disable=too-ma def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], project_name: str, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-05-15-preview") + api_version: str = kwargs.pop("api_version", "2025-11-15-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be 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 454e5bb430f6..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 @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,169 +7,9 @@ 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 TYPE_CHECKING, Any, Callable, Dict, Optional, TypeVar, Union -from azure.core import PipelineClient -from azure.core.credentials import AzureKeyCredential -from azure.core.pipeline import PipelineResponse, policies -from azure.core.polling import LROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from ._client import ( - ConversationAuthoringClient as AuthoringClientGenerated, - ConversationAuthoringProjectClient as AuthoringProjectClientGenerated, -) -from ._configuration import ConversationAuthoringProjectClientConfiguration -from ._utils.serialization import Deserializer, Serializer -from .operations._patch import ( - DeploymentOperations, - ExportedModelOperations, - ProjectOperations, - TrainedModelOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - -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-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**. - """ - self._project_name = project_name - _endpoint = f"{endpoint}/language" - - if api_version is not None: - kwargs["api_version"] = api_version - - # Build configuration - self._config = ConversationAuthoringProjectClientConfiguration( - endpoint=endpoint, credential=credential, project_name=project_name, **kwargs - ) - - # Build policies - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - - # Build pipeline client - self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - - # Setup serializers - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - - # Assign patched operation groups with project_name - self.deployment = DeploymentOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.project = ProjectOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.exported_model = ExportedModelOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.trained_model = TrainedModelOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - - -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-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, - ) - - @distributed_trace - def begin_delete_project(self, project_name: str, **kwargs: Any) -> LROPoller[None]: # pylint: disable=delete-operation-wrong-return-type - """Deletes a project. - - :param project_name: The name of the project to delete. Required. - :type project_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_delete_project( - project_name=project_name, **kwargs - ) +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -180,6 +19,3 @@ def patch_sdk(): 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 2acbba293ae8..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 @@ -346,7 +346,7 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: @@ -426,7 +426,7 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. @@ -514,9 +514,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -539,7 +537,7 @@ class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ @@ -624,7 +622,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -639,10 +637,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + 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__: @@ -681,7 +679,7 @@ def _deserialize(cls, data, exist_discriminators): mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -741,7 +739,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -751,7 +749,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -772,14 +770,14 @@ def _deserialize_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -844,7 +842,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -857,7 +858,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -975,11 +979,11 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ): self._type = type self._rest_name_input = name @@ -1037,11 +1041,11 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField( name=name, @@ -1058,8 +1062,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1078,9 +1082,9 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) @@ -1169,7 +1173,7 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: wrapped_element = _create_xml_element( meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None @@ -1212,7 +1216,7 @@ def _deserialize_xml( def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1225,7 +1229,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/serialization.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/serialization.py index eb86ea23c965..45a3e44e45cb 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/serialization.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -229,12 +227,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much 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 f35486776a1a..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 @@ -40,7 +40,7 @@ class ConversationAuthoringClient(_ConversationAuthoringClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -137,7 +137,7 @@ class ConversationAuthoringProjectClient: :param project_name: Required. :type project_name: str :keyword 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 + "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 @@ -178,10 +178,10 @@ def __init__( self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long - self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize) # type: ignore # pylint: disable=line-too-long + self.deployment = DeploymentOperations(self._client, self._config, self._serialize, self._deserialize) + self.project = ProjectOperations(self._client, self._config, self._serialize, self._deserialize) + self.exported_model = ExportedModelOperations(self._client, self._config, self._serialize, self._deserialize) + self.trained_model = TrainedModelOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_configuration.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_configuration.py index de5c6b140182..1e8010a7e763 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_configuration.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_configuration.py @@ -31,7 +31,7 @@ class ConversationAuthoringClientConfiguration: # pylint: disable=too-many-inst :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,7 +39,7 @@ class ConversationAuthoringClientConfiguration: # pylint: disable=too-many-inst def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-05-15-preview") + api_version: str = kwargs.pop("api_version", "2025-11-15-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -91,7 +91,7 @@ class ConversationAuthoringProjectClientConfiguration: # pylint: disable=too-ma :param project_name: Required. :type project_name: str :keyword 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 + "2025-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -103,7 +103,7 @@ def __init__( project_name: str, **kwargs: Any, ) -> None: - api_version: str = kwargs.pop("api_version", "2025-05-15-preview") + api_version: str = kwargs.pop("api_version", "2025-11-15-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") 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 a25eaffd3677..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 @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,165 +7,9 @@ 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 TYPE_CHECKING, Any, Callable, Dict, Optional, TypeVar, Union -from azure.core import AsyncPipelineClient -from azure.core.credentials import AzureKeyCredential -from azure.core.pipeline import PipelineResponse, policies -from azure.core.polling import AsyncLROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator_async import distributed_trace_async -from .._utils.serialization import Deserializer, Serializer -from ._configuration import ConversationAuthoringProjectClientConfiguration -from ._client import ( - ConversationAuthoringClient as AuthoringClientGenerated, - ConversationAuthoringProjectClient as AuthoringProjectClientGenerated, -) -from .operations._patch import ( - DeploymentOperations, - ExportedModelOperations, - ProjectOperations, - TrainedModelOperations, -) -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - - -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, "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. - """ - self._project_name = project_name - _endpoint = "{Endpoint}/language" - - if api_version is not None: - kwargs["api_version"] = api_version - - self._config = ConversationAuthoringProjectClientConfiguration( - endpoint=endpoint, credential=credential, project_name=project_name, **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - - # Assign patched operation groups with project_name - self.deployment = DeploymentOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.project = ProjectOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.exported_model = ExportedModelOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - self.trained_model = TrainedModelOperations( - self._client, self._config, self._serialize, self._deserialize, project_name=project_name - ) - - -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, - ) - - @distributed_trace_async - async def begin_delete_project(self, project_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """ - Delete a project. - - :param project_name: The name of the project to delete. Required. - :type project_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_delete_project( - project_name=project_name, **kwargs - ) +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -176,6 +19,3 @@ def patch_sdk(): 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/_deployment_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_deployment_op_patch.py deleted file mode 100644 index a5f99977cdb3..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_deployment_op_patch.py +++ /dev/null @@ -1,276 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...models import ( - CreateDeploymentDetails, - DeleteDeploymentDetails, - DeploymentDeleteFromResourcesState, - DeploymentState, - ProjectDeployment, -) -from ._operations import DeploymentOperations as DeploymentOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - - -class DeploymentOperations(DeploymentOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @distributed_trace_async - async def begin_delete_deployment( - self, - deployment_name: str, - **kwargs: Any, - ) -> AsyncLROPoller[None]: - """Deletes a project deployment. - - :param deployment_name: The deployment name. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_delete_deployment( - project_name=self._project_name, deployment_name=deployment_name, **kwargs - ) - - @overload - async def begin_delete_deployment_from_resources( - self, - deployment_name: str, - body: DeleteDeploymentDetails, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails - :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: - - """ - - @overload - async def begin_delete_deployment_from_resources( - self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. 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: - - """ - - @overload - 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 project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. 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: - - """ - - @distributed_trace_async - async def begin_delete_deployment_from_resources( - self, deployment_name: str, body: Union[DeleteDeploymentDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON or 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: - - """ - return await super()._begin_delete_deployment_from_resources( - project_name=self._project_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @overload - async def begin_deploy_project( - self, - deployment_name: str, - body: 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: - - """ - - @overload - 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: - - """ - - @overload - 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: - - """ - - @distributed_trace_async - async def begin_deploy_project( - self, deployment_name: str, body: Union[CreateDeploymentDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails or JSON or 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: - - """ - return await super()._begin_deploy_project( - project_name=self._project_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @distributed_trace - async def get_deployment(self, deployment_name: str, **kwargs: Any) -> ProjectDeployment: # type: ignore[override] - """Gets the details of a deployment. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :return: ProjectDeployment. The ProjectDeployment is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super().get_deployment(project_name=self._project_name, deployment_name=deployment_name, **kwargs) - - @distributed_trace - async def _get_deployment_delete_from_resources_status( # type: ignore[override] - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> DeploymentDeleteFromResourcesState: - """Gets the status of an existing delete deployment from specific resources job. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is - compatible with MutableMapping - :rtype: - ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_deployment_delete_from_resources_status( - project_name=self._project_name, deployment_name=deployment_name, job_id=job_id, **kwargs - ) - - @distributed_trace - async def _get_deployment_status( # type: ignore[override] - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> DeploymentState: - """Gets the status of an existing deployment job. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :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._models.DeploymentState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_deployment_status( - project_name=self._project_name, deployment_name=deployment_name, job_id=job_id, **kwargs - ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_exported_model_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_exported_model_op_patch.py deleted file mode 100644 index cd4ecd43907f..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_exported_model_op_patch.py +++ /dev/null @@ -1,177 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...models import ( - ExportedModelDetails, - ExportedModelState, - ExportedTrainedModel, -) -from ._operations import ExportedModelOperations as ExportedModelOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - - -class ExportedModelOperations(ExportedModelOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - async def begin_create_or_update_exported_model( - self, - exported_model_name: str, - body: 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: - """ - - @overload - 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: - """ - - @overload - 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: - """ - - @distributed_trace_async - async def begin_create_or_update_exported_model( - self, exported_model_name: str, body: Union[ExportedModelDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_create_or_update_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @distributed_trace_async - 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. - :type exported_model_name: str - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_delete_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - **kwargs, - ) - - @distributed_trace - async def get_exported_model( # type: ignore[override] - self, exported_model_name: str, **kwargs: Any - ) -> ExportedTrainedModel: - """Gets the details of an exported model. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :return: ExportedTrainedModel. The ExportedTrainedModel is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportedTrainedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super().get_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - **kwargs, - ) - - @distributed_trace - async def _get_exported_model_job_status( # type: ignore[override] - self, exported_model_name: str, job_id: str, **kwargs: Any - ) -> ExportedModelState: - """Gets the status for an existing job to create or update an exported model. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :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._models.ExportedModelState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_exported_model_job_status( - project_name=self._project_name, - exported_model_name=exported_model_name, - job_id=job_id, - **kwargs, - ) 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 a3e76ff24ccd..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,10 +6,10 @@ # 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, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -93,7 +93,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] _Unset: Any = object() @@ -120,7 +120,7 @@ def list_projects( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectDetails]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectDetails]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -172,7 +172,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.ProjectDetails], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectDetails], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -221,7 +221,7 @@ def list_supported_languages( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.SupportedLanguage]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SupportedLanguage]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -274,7 +274,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.SupportedLanguage], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.SupportedLanguage], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -298,9 +298,9 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + params_added_on={"2025-11-01": ["api_version", "top", "skip", "maxpagesize", "accept"]}, + api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def list_assigned_resource_deployments( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any @@ -322,7 +322,7 @@ def list_assigned_resource_deployments( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.AssignedProjectDeploymentsMetadata]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedProjectDeploymentsMetadata]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -374,7 +374,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.AssignedProjectDeploymentsMetadata], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedProjectDeploymentsMetadata], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -428,7 +428,7 @@ def list_supported_prebuilt_entities( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.PrebuiltEntity]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.PrebuiltEntity]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -482,7 +482,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.PrebuiltEntity], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.PrebuiltEntity], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -531,7 +531,7 @@ def list_training_config_versions( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.TrainingConfigVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.TrainingConfigVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -584,7 +584,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.TrainingConfigVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.TrainingConfigVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1056,11 +1056,9 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> _models.ProjectDeployment: + async def get_deployment(self, deployment_name: str, **kwargs: Any) -> _models.ProjectDeployment: """Gets the details of a deployment. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :return: ProjectDeployment. The ProjectDeployment is compatible with MutableMapping @@ -1081,8 +1079,8 @@ async def get_deployment(self, project_name: str, deployment_name: str, **kwargs cls: ClsType[_models.ProjectDeployment] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1119,11 +1117,7 @@ async def get_deployment(self, project_name: str, deployment_name: str, **kwargs return deserialized # type: ignore async def _deploy_project_initial( - self, - project_name: str, - deployment_name: str, - body: Union[_models._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, @@ -1147,8 +1141,8 @@ async def _deploy_project_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_deployment_deploy_project_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1188,7 +1182,6 @@ async def _deploy_project_initial( @overload async def _begin_deploy_project( self, - project_name: str, deployment_name: str, body: _models._models.CreateDeploymentDetails, *, @@ -1197,37 +1190,19 @@ async def _begin_deploy_project( ) -> AsyncLROPoller[None]: ... @overload async def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async async def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], - **kwargs: Any + 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. - :param project_name: The name of the project to use. Required. - :type project_name: str :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. Is one of the following types: CreateDeploymentDetails, @@ -1248,7 +1223,6 @@ async def _begin_deploy_project( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._deploy_project_initial( - project_name=project_name, deployment_name=deployment_name, body=body, content_type=content_type, @@ -1286,9 +1260,7 @@ 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 - async def _delete_deployment_initial( - self, project_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + async def _delete_deployment_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1303,8 +1275,8 @@ async def _delete_deployment_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_deployment_delete_deployment_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1340,13 +1312,9 @@ async def _delete_deployment_initial( return deserialized # type: ignore @distributed_trace_async - async def _begin_delete_deployment( - self, project_name: str, 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 project_name: The name of the project to use. Required. - :type project_name: str :param deployment_name: The name of the specific deployment of the project to use. Required. :type deployment_name: str :return: An instance of AsyncLROPoller that returns None @@ -1362,12 +1330,7 @@ async def _begin_delete_deployment( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_deployment_initial( - project_name=project_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + deployment_name=deployment_name, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -1399,16 +1362,12 @@ 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 @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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 _delete_deployment_from_resources_initial( # pylint: disable=name-too-long - self, - project_name: str, - deployment_name: str, - body: Union[_models._models.DeleteDeploymentDetails, 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, @@ -1432,8 +1391,8 @@ async def _delete_deployment_from_resources_initial( # pylint: disable=name-too _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_deployment_delete_deployment_from_resources_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1473,7 +1432,6 @@ async def _delete_deployment_from_resources_initial( # pylint: disable=name-too @overload async def _begin_delete_deployment_from_resources( self, - project_name: str, deployment_name: str, body: _models._models.DeleteDeploymentDetails, *, @@ -1482,46 +1440,29 @@ async def _begin_delete_deployment_from_resources( ) -> AsyncLROPoller[None]: ... @overload async def _begin_delete_deployment_from_resources( - self, - project_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_delete_deployment_from_resources( - self, - project_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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, - project_name: str, - deployment_name: str, - body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], - **kwargs: Any + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a project deployment from the specified assigned resources. + """Deletes a deployment from the specified project-assigned resources. - :param project_name: The name of the project to use. Required. - :type project_name: str :param deployment_name: The name of the specific deployment of the project to use. Required. :type deployment_name: str - :param body: The options for deleting the deployment. Is one of the following types: - DeleteDeploymentDetails, JSON, IO[bytes] Required. + :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: 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 @@ -1538,7 +1479,6 @@ async def _begin_delete_deployment_from_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_deployment_from_resources_initial( - project_name=project_name, deployment_name=deployment_name, body=body, content_type=content_type, @@ -1578,17 +1518,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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 - self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + self, deployment_name: str, job_id: str, **kwargs: Any ) -> _models._models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :param job_id: The job ID. Required. @@ -1613,9 +1551,9 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( - project_name=project_name, deployment_name=deployment_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1655,12 +1593,10 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- @distributed_trace_async async def _get_deployment_status( - self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + self, deployment_name: str, job_id: str, **kwargs: Any ) -> _models._models.DeploymentState: """Gets the status of an existing deployment job. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :param job_id: The job ID. Required. @@ -1683,9 +1619,9 @@ async def _get_deployment_status( cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( - project_name=project_name, deployment_name=deployment_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1745,12 +1681,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_trained_models( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ProjectTrainedModel"]: """Lists the trained models belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -1764,7 +1698,7 @@ def list_trained_models( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectTrainedModel]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectTrainedModel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1778,7 +1712,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_trained_models_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -1817,7 +1751,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.ProjectTrainedModel], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectTrainedModel], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1841,12 +1775,10 @@ async def get_next(next_link=None): @distributed_trace def list_training_jobs( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.TrainingState"]: """Lists the non-expired training jobs created for a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -1860,7 +1792,7 @@ def list_training_jobs( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.TrainingState]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.TrainingState]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1874,7 +1806,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_training_jobs_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -1913,7 +1845,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.TrainingState], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.TrainingState], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1937,17 +1869,15 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AssignedDeploymentResource"]: - """Lists the deployments resources assigned to the project. + """Lists the Language or AIService resources assigned to the project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -1961,7 +1891,7 @@ def list_deployment_resources( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1975,7 +1905,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -2014,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.AssignedDeploymentResource], 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) @@ -2038,12 +1968,10 @@ async def get_next(next_link=None): @distributed_trace def list_deployments( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ProjectDeployment"]: """Lists the deployments belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -2057,7 +1985,7 @@ def list_deployments( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectDeployment]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectDeployment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2071,7 +1999,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_deployments_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -2110,7 +2038,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.ProjectDeployment], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectDeployment], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2134,17 +2062,15 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + params_added_on={"2025-05-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def list_exported_models( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ExportedTrainedModel"]: """Lists the exported models belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -2158,7 +2084,7 @@ def list_exported_models( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ExportedTrainedModel]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ExportedTrainedModel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2172,7 +2098,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_exported_models_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -2211,7 +2137,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.ExportedTrainedModel], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ExportedTrainedModel], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2234,15 +2160,12 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_initial( - self, - project_name: str, - body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2266,7 +2189,7 @@ async def _assign_deployment_resources_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_assign_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2306,7 +2229,6 @@ async def _assign_deployment_resources_initial( @overload async def _begin_assign_deployment_resources( self, - project_name: str, body: _models._models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", @@ -2314,34 +2236,29 @@ async def _begin_assign_deployment_resources( ) -> AsyncLROPoller[None]: ... @overload async def _begin_assign_deployment_resources( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_assign_deployment_resources( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, - project_name: str, - body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: + """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 project_name: The name of the project to use. Required. - :type project_name: str - :param body: The new project resources info. Is one of the following types: + :param body: The new project resources to be assigned. Is one of the following types: AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. :type body: ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or @@ -2360,13 +2277,7 @@ async def _begin_assign_deployment_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._assign_deployment_resources_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + 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 kwargs.pop("error_map", None) @@ -2398,15 +2309,12 @@ 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 @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_initial( - self, - project_name: str, - body: Union[_models._models.UnassignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2430,7 +2338,7 @@ async def _unassign_deployment_resources_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_unassign_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2469,44 +2377,32 @@ async def _unassign_deployment_resources_initial( @overload async def _begin_unassign_deployment_resources( - self, - project_name: str, - body: _models._models.UnassignDeploymentResourcesDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_unassign_deployment_resources( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_unassign_deployment_resources( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, - project_name: str, - body: Union[_models._models.UnassignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. + """Unassign resources from a project. This disallows deployment to these resources. - :param project_name: The name of the project to use. Required. - :type project_name: str - :param body: The info for the deployment resources to be deleted. Is one of the following - types: UnassignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: - ~azure.ai.language.conversations.authoring.models._models.UnassignDeploymentResourcesDetails or - JSON or IO[bytes] + :param body: The list of Language or AIService Azure resource IDs to be unassigned. 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: @@ -2521,13 +2417,7 @@ async def _begin_unassign_deployment_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._unassign_deployment_resources_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + 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 kwargs.pop("error_map", None) @@ -2560,17 +2450,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_status( - self, project_name: str, job_id: str, **kwargs: Any + self, job_id: str, **kwargs: Any ) -> _models._models.DeploymentResourcesState: - """Gets the status of an existing assign deployment resources job. + """Gets the status of an existing assign project resources job. - :param project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with @@ -2592,8 +2480,8 @@ async def _get_assign_deployment_resources_status( cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_deployment_resources_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2633,17 +2521,15 @@ async def _get_assign_deployment_resources_status( @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_status( # pylint: disable=name-too-long - self, project_name: str, job_id: str, **kwargs: Any + self, job_id: str, **kwargs: Any ) -> _models._models.DeploymentResourcesState: - """Gets the status of an existing unassign deployment resources job. + """Gets the status of an existing unassign project resources job. - :param project_name: The name of the project to use. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with @@ -2665,8 +2551,8 @@ async def _get_unassign_deployment_resources_status( # pylint: disable=name-too cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_deployment_resources_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2705,7 +2591,7 @@ async def _get_unassign_deployment_resources_status( # pylint: disable=name-too return deserialized # type: ignore async def _swap_deployments_initial( - self, project_name: str, body: Union[_models._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, @@ -2729,7 +2615,7 @@ async def _swap_deployments_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_swap_deployments_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2768,30 +2654,23 @@ async def _swap_deployments_initial( @overload async def _begin_swap_deployments( - self, - project_name: str, - body: _models._models.SwapDeploymentsDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_swap_deployments( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_swap_deployments( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async async def _begin_swap_deployments( - self, project_name: str, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Swaps two existing deployments with each other. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.SwapDeploymentsDetails or @@ -2810,13 +2689,7 @@ async def _begin_swap_deployments( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._swap_deployments_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + 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 kwargs.pop("error_map", None) @@ -2848,13 +2721,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_swap_deployments_status( - self, project_name: str, job_id: str, **kwargs: Any - ) -> _models._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: SwapDeploymentsState. The SwapDeploymentsState is compatible with MutableMapping @@ -2875,8 +2744,8 @@ async def _get_swap_deployments_status( cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2915,11 +2784,9 @@ async def _get_swap_deployments_status( return deserialized # type: ignore @distributed_trace_async - async def _get_project(self, project_name: str, **kwargs: Any) -> _models.ProjectDetails: + async def _get_project(self, **kwargs: Any) -> _models.ProjectDetails: """Gets the details of a project. - :param project_name: The new project name. Required. - :type project_name: str :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -2938,7 +2805,7 @@ async def _get_project(self, project_name: str, **kwargs: Any) -> _models.Projec cls: ClsType[_models.ProjectDetails] = kwargs.pop("cls", None) _request = build_project_get_project_request( - project_name=project_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3038,7 +2905,6 @@ async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mod async def _import_method_initial( self, - project_name: str, body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3066,7 +2932,7 @@ async def _import_method_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_import_method_request( - project_name=project_name, + project_name=self._config.project_name, exported_project_format=exported_project_format, content_type=content_type, api_version=self._config.api_version, @@ -3107,7 +2973,6 @@ async def _import_method_initial( @overload async def _begin_import_method( self, - project_name: str, body: _models._models.ExportedProject, *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3117,7 +2982,6 @@ async def _begin_import_method( @overload async def _begin_import_method( self, - project_name: str, body: JSON, *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3127,7 +2991,6 @@ async def _begin_import_method( @overload async def _begin_import_method( self, - project_name: str, body: IO[bytes], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3138,7 +3001,6 @@ async def _begin_import_method( @distributed_trace_async async def _begin_import_method( self, - project_name: str, body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3147,8 +3009,6 @@ async def _begin_import_method( """Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.ExportedProject or JSON @@ -3171,7 +3031,6 @@ async def _begin_import_method( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._import_method_initial( - project_name=project_name, body=body, exported_project_format=exported_project_format, content_type=content_type, @@ -3211,7 +3070,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _export_initial( self, - project_name: str, *, string_index_type: Union[str, _models.StringIndexType], exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3233,7 +3091,7 @@ async def _export_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_project_export_request( - project_name=project_name, + project_name=self._config.project_name, string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, @@ -3275,7 +3133,6 @@ async def _export_initial( @distributed_trace_async async def _begin_export( self, - project_name: str, *, string_index_type: Union[str, _models.StringIndexType], exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -3285,8 +3142,6 @@ async def _begin_export( ) -> AsyncLROPoller[None]: """Triggers a job to export a project's data. - :param project_name: The name of the project to use. Required. - :type project_name: str :keyword string_index_type: Specifies the method used to interpret string offsets. For additional information see `https://aka.ms/text-analytics-offsets `_. Known values are: "Utf16CodeUnit", "Utf8CodeUnit", @@ -3315,7 +3170,6 @@ async def _begin_export( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._export_initial( - project_name=project_name, string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, @@ -3355,13 +3209,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._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping @@ -3382,8 +3232,8 @@ async def _get_export_status( cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3424,7 +3274,6 @@ async def _get_export_status( @overload async def _copy_project_authorization( self, - project_name: str, *, project_kind: Union[str, _models.ProjectKind], content_type: str = "application/json", @@ -3434,22 +3283,21 @@ async def _copy_project_authorization( ) -> _models._models.CopyProjectDetails: ... @overload async def _copy_project_authorization( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models._models.CopyProjectDetails: ... @overload async def _copy_project_authorization( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models._models.CopyProjectDetails: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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( self, - project_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, project_kind: Union[str, _models.ProjectKind] = _Unset, @@ -3459,8 +3307,6 @@ async def _copy_project_authorization( ) -> _models._models.CopyProjectDetails: """Generates a copy project operation authorization to the current target Azure resource. - :param project_name: The new project name. Required. - :type project_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword project_kind: Represents the project kind. Known values are: "Conversation", @@ -3507,7 +3353,7 @@ async def _copy_project_authorization( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_copy_project_authorization_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3548,12 +3394,12 @@ async def _copy_project_authorization( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _copy_project_initial( - self, project_name: str, body: Union[_models._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, @@ -3577,7 +3423,7 @@ async def _copy_project_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_copy_project_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3616,35 +3462,28 @@ async def _copy_project_initial( @overload async def _begin_copy_project( - self, - project_name: str, - body: _models._models.CopyProjectDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_copy_project( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_copy_project( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Copies an existing project to another Azure resource. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.CopyProjectDetails or @@ -3663,13 +3502,7 @@ async def _begin_copy_project( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._copy_project_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + 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 kwargs.pop("error_map", None) @@ -3702,17 +3535,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, job_id: str, **kwargs: Any - ) -> _models._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: CopyProjectState. The CopyProjectState is compatible with MutableMapping @@ -3733,8 +3562,8 @@ async def _get_copy_project_status( cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3773,7 +3602,7 @@ async def _get_copy_project_status( return deserialized # type: ignore async def _train_initial( - self, project_name: str, body: Union[_models._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, @@ -3797,7 +3626,7 @@ async def _train_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_train_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3836,30 +3665,23 @@ async def _train_initial( @overload async def _begin_train( - self, - project_name: str, - body: _models._models.TrainingJobDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @overload async def _begin_train( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @overload async def _begin_train( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.TrainingJobResult]: ... @distributed_trace_async async def _begin_train( - self, project_name: str, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.TrainingJobResult]: """Triggers a training job for a project. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.TrainingJobDetails or @@ -3880,13 +3702,7 @@ async def _begin_train( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._train_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + 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 kwargs.pop("error_map", None) @@ -3928,11 +3744,9 @@ def get_long_running_output(pipeline_response): ) @distributed_trace_async - async def _get_training_status(self, project_name: str, 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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: TrainingState. The TrainingState is compatible with MutableMapping @@ -3953,8 +3767,8 @@ async def _get_training_status(self, project_name: str, job_id: str, **kwargs: A cls: ClsType[_models.TrainingState] = kwargs.pop("cls", None) _request = build_project_get_training_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3990,7 +3804,7 @@ async def _get_training_status(self, project_name: str, job_id: str, **kwargs: A return deserialized # type: ignore - async def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: Any) -> AsyncIterator[bytes]: + async def _cancel_training_job_initial(self, job_id: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4005,8 +3819,8 @@ async def _cancel_training_job_initial(self, project_name: str, job_id: str, **k cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_project_cancel_training_job_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4042,13 +3856,9 @@ async def _cancel_training_job_initial(self, project_name: str, job_id: str, **k return deserialized # type: ignore @distributed_trace_async - async def _begin_cancel_training_job( - self, project_name: str, job_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: + async def begin_cancel_training_job(self, job_id: str, **kwargs: Any) -> AsyncLROPoller[_models.TrainingJobResult]: """Triggers a cancellation for a running training job. - :param project_name: The name of the project to use. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is @@ -4066,12 +3876,7 @@ async def _begin_cancel_training_job( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._cancel_training_job_initial( - project_name=project_name, - job_id=job_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + job_id=job_id, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -4134,17 +3939,13 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "accept"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "accept"]}, + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - async def get_exported_model( - self, project_name: str, exported_model_name: str, **kwargs: Any - ) -> _models.ExportedTrainedModel: + async def get_exported_model(self, exported_model_name: str, **kwargs: Any) -> _models.ExportedTrainedModel: """Gets the details of an exported model. - :param project_name: The new project name. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :return: ExportedTrainedModel. The ExportedTrainedModel is compatible with MutableMapping @@ -4165,8 +3966,8 @@ async def get_exported_model( cls: ClsType[_models.ExportedTrainedModel] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4203,13 +4004,11 @@ async def get_exported_model( return deserialized # type: ignore @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _delete_exported_model_initial( - self, project_name: str, exported_model_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + async def _delete_exported_model_initial(self, exported_model_name: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4224,8 +4023,8 @@ async def _delete_exported_model_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_exported_model_delete_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4262,17 +4061,13 @@ async def _delete_exported_model_initial( @distributed_trace_async @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, 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 project_name: The name of the project to use. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :return: An instance of AsyncLROPoller that returns None @@ -4288,7 +4083,6 @@ async def _begin_delete_exported_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_exported_model_initial( - project_name=project_name, exported_model_name=exported_model_name, cls=lambda x, y, z: x, headers=_headers, @@ -4325,13 +4119,12 @@ 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 @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _create_or_update_exported_model_initial( self, - project_name: str, exported_model_name: str, body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any @@ -4358,8 +4151,8 @@ async def _create_or_update_exported_model_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_exported_model_create_or_update_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4399,7 +4192,6 @@ async def _create_or_update_exported_model_initial( @overload async def _begin_create_or_update_exported_model( self, - project_name: str, exported_model_name: str, body: _models._models.ExportedModelDetails, *, @@ -4408,42 +4200,27 @@ async def _begin_create_or_update_exported_model( ) -> AsyncLROPoller[None]: ... @overload async def _begin_create_or_update_exported_model( - self, - project_name: str, - exported_model_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, exported_model_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def _begin_create_or_update_exported_model( - self, - project_name: str, - exported_model_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, exported_model_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, - project_name: str, 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. - :param project_name: The name of the project to use. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :param body: The exported model info. Is one of the following types: ExportedModelDetails, @@ -4464,7 +4241,6 @@ async def _begin_create_or_update_exported_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_or_update_exported_model_initial( - project_name=project_name, exported_model_name=exported_model_name, body=body, content_type=content_type, @@ -4504,19 +4280,17 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async @api_version_validation( - method_added_on="2024-11-15-preview", + method_added_on="2025-05-15-preview", params_added_on={ - "2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "job_id", "accept"] + "2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "job_id", "accept"] }, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) async def _get_exported_model_job_status( - self, project_name: str, exported_model_name: str, job_id: str, **kwargs: Any + self, exported_model_name: str, job_id: str, **kwargs: Any ) -> _models._models.ExportedModelState: """Gets the status for an existing job to create or update an exported model. - :param project_name: The new project name. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :param job_id: The job ID. Required. @@ -4539,9 +4313,9 @@ async def _get_exported_model_job_status( cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( - project_name=project_name, exported_model_name=exported_model_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4600,13 +4374,9 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get_trained_model( - self, project_name: str, trained_model_label: str, **kwargs: Any - ) -> _models.ProjectTrainedModel: + async def get_trained_model(self, trained_model_label: str, **kwargs: Any) -> _models.ProjectTrainedModel: """Gets the details of a trained model. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: ProjectTrainedModel. The ProjectTrainedModel is compatible with MutableMapping @@ -4627,8 +4397,8 @@ async def get_trained_model( cls: ClsType[_models.ProjectTrainedModel] = kwargs.pop("cls", None) _request = build_trained_model_get_trained_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4665,11 +4435,9 @@ async def get_trained_model( return deserialized # type: ignore @distributed_trace_async - async def delete_trained_model(self, project_name: str, trained_model_label: str, **kwargs: Any) -> None: + async def delete_trained_model(self, trained_model_label: str, **kwargs: Any) -> None: """Deletes an existing trained model. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: None @@ -4690,8 +4458,8 @@ async def delete_trained_model(self, project_name: str, trained_model_label: str cls: ClsType[None] = kwargs.pop("cls", None) _request = build_trained_model_delete_trained_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4716,16 +4484,12 @@ async def delete_trained_model(self, project_name: str, trained_model_label: str return cls(pipeline_response, None, {}) # type: ignore @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _evaluate_model_initial( - self, - project_name: str, - trained_model_label: str, - body: Union[_models.EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any + self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4749,8 +4513,8 @@ async def _evaluate_model_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_trained_model_evaluate_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4790,7 +4554,6 @@ async def _evaluate_model_initial( @overload async def _begin_evaluate_model( self, - project_name: str, trained_model_label: str, body: _models.EvaluationDetails, *, @@ -4799,42 +4562,24 @@ async def _begin_evaluate_model( ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @overload async def _begin_evaluate_model( - self, - project_name: str, - trained_model_label: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @overload async def _begin_evaluate_model( - self, - project_name: str, - trained_model_label: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: ... @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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( - self, - project_name: str, - trained_model_label: str, - body: Union[_models.EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any + self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models._models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. - :param project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param body: The training input parameters. Is one of the following types: EvaluationDetails, @@ -4857,7 +4602,6 @@ async def _begin_evaluate_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._evaluate_model_initial( - project_name=project_name, trained_model_label=trained_model_label, body=body, content_type=content_type, @@ -4898,19 +4642,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models._models.EvaluationJobResult].from_continuation_token( # pylint:disable=protected-access + 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._models.EvaluationJobResult]( # pylint:disable=protected-access + return AsyncLROPoller[_models._models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _load_snapshot_initial( - self, project_name: str, trained_model_label: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + async def _load_snapshot_initial(self, trained_model_label: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4925,8 +4667,8 @@ async def _load_snapshot_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_trained_model_load_snapshot_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4962,13 +4704,9 @@ async def _load_snapshot_initial( return deserialized # type: ignore @distributed_trace_async - async def _begin_load_snapshot( - self, project_name: str, 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 project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: An instance of AsyncLROPoller that returns None @@ -4984,7 +4722,6 @@ async def _begin_load_snapshot( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._load_snapshot_initial( - project_name=project_name, trained_model_label=trained_model_label, cls=lambda x, y, z: x, headers=_headers, @@ -5022,19 +4759,17 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async @api_version_validation( - method_added_on="2023-04-15-preview", + method_added_on="2025-05-15-preview", params_added_on={ - "2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "job_id", "accept"] + "2025-05-15-preview": ["api_version", "project_name", "trained_model_label", "job_id", "accept"] }, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) async def _get_evaluation_status( - self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + self, trained_model_label: str, job_id: str, **kwargs: Any ) -> _models._models.EvaluationState: """Gets the status for an evaluation job. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param job_id: The job ID. Required. @@ -5057,9 +4792,9 @@ async def _get_evaluation_status( cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( - project_name=project_name, trained_model_label=trained_model_label, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5100,7 +4835,6 @@ async def _get_evaluation_status( @distributed_trace def get_model_evaluation_results( self, - project_name: str, trained_model_label: str, *, string_index_type: Union[str, _models.StringIndexType], @@ -5111,8 +4845,6 @@ def get_model_evaluation_results( """Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :keyword string_index_type: Specifies the method used to interpret string offsets. For @@ -5134,7 +4866,7 @@ def get_model_evaluation_results( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.UtteranceEvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.UtteranceEvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5148,8 +4880,8 @@ def prepare_request(next_link=None): if not next_link: _request = build_trained_model_get_model_evaluation_results_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, string_index_type=string_index_type, top=top, skip=skip, @@ -5189,7 +4921,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.UtteranceEvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.UtteranceEvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -5212,14 +4944,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_model_evaluation_summary( - self, project_name: str, trained_model_label: str, **kwargs: Any - ) -> _models.EvalSummary: + async def get_model_evaluation_summary(self, trained_model_label: str, **kwargs: Any) -> _models.EvalSummary: """Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - :param project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: EvalSummary. The EvalSummary is compatible with MutableMapping @@ -5240,8 +4968,8 @@ async def get_model_evaluation_summary( cls: ClsType[_models.EvalSummary] = kwargs.pop("cls", None) _request = build_trained_model_get_model_evaluation_summary_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5279,12 +5007,10 @@ async def get_model_evaluation_summary( @distributed_trace_async async def _get_load_snapshot_status( - self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + self, trained_model_label: str, job_id: str, **kwargs: Any ) -> _models._models.LoadSnapshotState: """Gets the status for loading a snapshot. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param job_id: The job ID. Required. @@ -5307,9 +5033,9 @@ async def _get_load_snapshot_status( cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( - project_name=project_name, trained_model_label=trained_model_label, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, 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 43cd6bc6524b..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,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,10 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from ._project_op_patch import ProjectOperations -from ._trained_model_op_patch import TrainedModelOperations -from ._deployment_op_patch import DeploymentOperations -from ._exported_model_op_patch import ExportedModelOperations + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -21,6 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ProjectOperations", "DeploymentOperations", "ExportedModelOperations", "TrainedModelOperations"] 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 d796a038c888..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py +++ /dev/null @@ -1,913 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, cast, overload - -from azure.core.async_paging import AsyncItemPaged -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 import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async - -from ..._utils.model_base import _deserialize -from ...models._patch import _AsyncJobsPollingMethod -from ...models import ( - AssignedDeploymentResource, - AssignDeploymentResourcesDetails, - CopyProjectDetails, - CopyProjectState, - DeploymentResourcesState, - ExportProjectState, - ExportedProject, - ExportedProjectFormat, - ExportedTrainedModel, - ProjectDeletionState, - ProjectDeployment, - ProjectDetails, - ProjectKind, - ProjectTrainedModel, - StringIndexType, - SwapDeploymentsDetails, - SwapDeploymentsState, - TrainingJobDetails, - TrainingJobResult, - TrainingState, - UnassignDeploymentResourcesDetails, -) -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.""" - - def __init__(self, *args, project_name: str, **kwargs: Any): - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - async def begin_import( - self, - body: ExportedProject, - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @overload - async def begin_import( - self, - body: JSON, - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @overload - async def begin_import( - self, - body: IO[bytes], - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @distributed_trace_async - async def begin_import( - self, - body: Union[ExportedProject, JSON, IO[bytes]], - *, - exported_project_format: Optional[Union[str, 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 or JSON or IO[bytes] - :keyword exported_project_format: The format of the exported project file to use. Known values are: "Conversation" and "Luis". - :paramtype exported_project_format: str or ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of AsyncLROPoller that returns None. - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - return await super()._begin_import_method( - project_name=self._project_name, - body=body, - exported_project_format=exported_project_format, - content_type=content_type, - **kwargs, - ) - - @overload - async def begin_assign_deployment_resources( - self, body: AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails - :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: - """ - - @overload - async def begin_assign_deployment_resources( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources 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: - """ - - @overload - async def begin_assign_deployment_resources( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources 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: - """ - - @distributed_trace_async - async def begin_assign_deployment_resources( - self, body: Union[AssignDeploymentResourcesDetails, JSON, IO[bytes]], *, content_type: str = "application/json",**kwargs: Any - ) -> AsyncLROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. - This API is available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, see: - https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - - :param body: The new project resources info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of AsyncLROPoller that returns None. - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_assign_deployment_resources( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - async def begin_swap_deployments( - self, body: 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 LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - 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 LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - 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 LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_swap_deployments( - self, body: Union[SwapDeploymentsDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of AsyncLROPoller that returns None. - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_swap_deployments( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - async def begin_unassign_deployment_resources( - self, body: UnassignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. Required. - :type body: ~azure.ai.language.conversations.authoring.models.UnassignDeploymentResourcesDetails - :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: - """ - - @overload - 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 deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. 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: - """ - - @overload - 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 deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. 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: - """ - - @distributed_trace_async - async def begin_unassign_deployment_resources( - self, body: Union[UnassignDeploymentResourcesDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. Required. - :type body: ~azure.ai.language.conversations.authoring.models.UnassignDeploymentResourcesDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_unassign_deployment_resources( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @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] - ) - - @overload - async def begin_copy_project( - self, body: 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 LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - - @overload - 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: - - """ - - @overload - 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". - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of AsyncLROPoller that returns None. - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - - @distributed_trace_async - async def begin_copy_project( - self, body: Union[CopyProjectDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails or JSON or 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: - - """ - return await super()._begin_copy_project( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - async def begin_train( - self, body: TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[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: - - """ - - @overload - async def begin_train( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[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: - - """ - - @overload - async def begin_train( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[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: - - """ - - @distributed_trace_async - async def begin_train( # type: ignore[override] - self, body: Union[TrainingJobDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[TrainingJobResult]: - """ - Triggers a training job for a project. - - :param body: The training job request payload. - :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails or JSON or IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON or binary body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TrainingJobResult. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.models.TrainingJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - return await super()._begin_train( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @distributed_trace_async - async def begin_export( - self, - *, - string_index_type: Union[str, StringIndexType], - exported_project_format: Optional[Union[str, ExportedProjectFormat]] = None, - asset_kind: Optional[str] = None, - trained_model_label: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Triggers a job to export a project's data. - - :keyword string_index_type: Specifies the method used to interpret string offsets. See - https://aka.ms/text-analytics-offsets. Known values: "Utf16CodeUnit", "Utf8CodeUnit", - "Utf32CodeUnit". Required. - :paramtype string_index_type: str or ~azure.ai.language.conversations.authoring.models.StringIndexType - :keyword exported_project_format: The export format. Known values: "Conversation", "Luis". - :paramtype exported_project_format: str or ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword asset_kind: Kind of asset to export. - :paramtype asset_kind: str - :keyword trained_model_label: Trained model label to export. If None, exports the working copy. - :paramtype trained_model_label: str - :return: An instance of AsyncLROPoller that returns None. - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_export( - project_name=self._project_name, - asset_kind=asset_kind, - exported_project_format=exported_project_format, - string_index_type=string_index_type, - trained_model_label=trained_model_label, - **kwargs, - ) - - @overload - async def copy_project_authorization( - self, - *, - project_kind: Union[str, ProjectKind], - content_type: str = "application/json", - storage_input_container_name: Optional[str] = None, - allow_overwrite: Optional[bool] = None, - **kwargs: Any - ) -> 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: - """ - - @overload - async def copy_project_authorization( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> 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: - """ - - @overload - async def copy_project_authorization( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> 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: - """ - - @distributed_trace_async - async def copy_project_authorization( # type: ignore[override] - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - allow_overwrite: Optional[bool] = _Unset, - project_kind: Union[str, Any] = _Unset, - storage_input_container_name: Optional[str] = _Unset, - **kwargs: Any - ) -> 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. - :type body: JSON or IO[bytes] - :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 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._models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._copy_project_authorization( - project_name=self._project_name, - body=body, - allow_overwrite=allow_overwrite, - project_kind=project_kind, - storage_input_container_name=storage_input_container_name, - **kwargs, - ) - - @distributed_trace_async - async def _get_assign_deployment_resources_status( # type: ignore[override] - self, job_id: str, **kwargs: Any - ) -> DeploymentResourcesState: - """Gets the status of an existing assign deployment resources job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_assign_deployment_resources_status( - project_name=self._project_name, job_id=job_id, **kwargs - ) - - @distributed_trace_async - async def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> CopyProjectState: # type: ignore[override] - """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._models.CopyProjectState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_copy_project_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace_async - async def _get_export_status(self, job_id: str, **kwargs: Any) -> ExportProjectState: # type: ignore[override] - """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._models.ExportProjectState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_export_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace_async - async def get_project(self, **kwargs: Any) -> ProjectDetails: # type: ignore[override] - """Gets the details of a project. - - :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_project(project_name=self._project_name, **kwargs) - - @distributed_trace_async - async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> ProjectDeletionState: # type: ignore[override] - """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._models.ProjectDeletionState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_project_deletion_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace_async - async def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> SwapDeploymentsState: # type: ignore[override] - """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._models.SwapDeploymentsState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_swap_deployments_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace_async - async def _get_training_status(self, job_id: str, **kwargs: Any) -> TrainingState: # type: ignore[override] - """Gets the status for a training job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: TrainingState. The TrainingState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.TrainingState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_training_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace_async - async def _get_unassign_deployment_resources_status( # type: ignore[override] - self, job_id: str, **kwargs: Any - ) -> DeploymentResourcesState: - """Gets the status of an existing unassign deployment resources job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_unassign_deployment_resources_status( - project_name=self._project_name, job_id=job_id, **kwargs - ) - - @distributed_trace - def list_deployment_resources( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> AsyncItemPaged[AssignedDeploymentResource]: - """Lists the deployments 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 AssignedDeploymentResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_deployment_resources(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_deployments( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> AsyncItemPaged[ProjectDeployment]: - """Lists the deployments belonging to a 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 ProjectDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.ProjectDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_deployments(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_exported_models( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> AsyncItemPaged[ExportedTrainedModel]: - """Lists the exported models belonging to a 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 ExportedTrainedModel - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.ExportedTrainedModel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_exported_models(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_trained_models( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> AsyncItemPaged[ProjectTrainedModel]: - """Lists the trained models belonging to a 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 ProjectTrainedModel - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.ProjectTrainedModel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_trained_models(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_training_jobs( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> AsyncItemPaged[TrainingState]: - """Lists the non-expired training jobs created for a 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 TrainingState - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.TrainingState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_training_jobs(project_name=self._project_name, skip=skip, top=top, **kwargs) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_trained_model_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_trained_model_op_patch.py deleted file mode 100644 index 77812219d78e..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_trained_model_op_patch.py +++ /dev/null @@ -1,288 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.async_paging import AsyncItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async - -from ...models import ( - EvalSummary, - EvaluationDetails, - EvaluationJobResult, - EvaluationState, - LoadSnapshotState, - ProjectTrainedModel, - StringIndexType, - UtteranceEvaluationResult, -) -from ._operations import TrainedModelOperations as TrainedModelOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - - -class TrainedModelOperations(TrainedModelOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - async def begin_evaluate_model( - self, - trained_model_label: str, - body: EvaluationDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[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: - """ - - @overload - async def begin_evaluate_model( - self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[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: - """ - - @overload - async def begin_evaluate_model( - self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[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: - """ - - @distributed_trace - async def begin_evaluate_model( # type: ignore[override] - self, - trained_model_label: str, - body: Union[EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[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. Is one of the following types: EvaluationDetails, - JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.EvaluationDetails or JSON or - IO[bytes] - :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._models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_evaluate_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - body=body, - **kwargs, - ) - - @distributed_trace_async - 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. - :type trained_model_label: str - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._begin_load_snapshot( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace_async - async def delete_trained_model(self, trained_model_label: str, **kwargs: Any) -> None: # type: ignore[override] - """Deletes an existing trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super().delete_trained_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace_async - async def _get_evaluation_status( # type: ignore[override] - self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> EvaluationState: - """Gets the status for an evaluation job. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :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._models.EvaluationState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_evaluation_status( - project_name=self._project_name, - trained_model_label=trained_model_label, - job_id=job_id, - **kwargs, - ) - - @distributed_trace_async - async def _get_load_snapshot_status( # type: ignore[override] - self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> LoadSnapshotState: - """Gets the status for loading a snapshot. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :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._models.LoadSnapshotState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super()._get_load_snapshot_status( - project_name=self._project_name, - trained_model_label=trained_model_label, - job_id=job_id, - **kwargs, - ) - - @distributed_trace - def get_model_evaluation_results( # type: ignore[override] - self, - trained_model_label: str, - *, - skip: Optional[int] = None, - string_index_type: Union[str, StringIndexType], - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged[UtteranceEvaluationResult]: - """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see `https://aka.ms/text-analytics-offsets - `_. Known values are: "Utf16CodeUnit", "Utf8CodeUnit", - and "Utf32CodeUnit". Required. - :paramtype string_index_type: str or - ~azure.ai.language.conversations.authoring.models.StringIndexType - :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 UtteranceEvaluationResult - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.UtteranceEvaluationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_model_evaluation_results( - project_name=self._project_name, - trained_model_label=trained_model_label, - skip=skip, - string_index_type=string_index_type, - top=top, - **kwargs, - ) - - @distributed_trace_async - async def get_model_evaluation_summary( # type: ignore[override] - self, trained_model_label: str, **kwargs: Any - ) -> EvalSummary: - """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: EvalSummary. The EvalSummary is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.EvalSummary - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super().get_model_evaluation_summary( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace_async - async def get_trained_model( # type: ignore[override] - self, trained_model_label: str, **kwargs: Any - ) -> ProjectTrainedModel: - """Gets the details of a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: ProjectTrainedModel. The ProjectTrainedModel is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectTrainedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - return await super().get_trained_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) 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 dace41355e12..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 @@ -20,8 +20,6 @@ ConfusionMatrixCell, ConfusionMatrixRow, CreateProjectOptions, - DataGenerationConnectionInfo, - DeploymentResource, EntitiesEvaluationSummary, EntityEvaluationSummary, EvalSummary, @@ -46,7 +44,6 @@ ) from ._enums import ( # type: ignore - DataGenerationConnectionKind, EvaluationKind, OperationStatus, ProjectKind, @@ -64,8 +61,6 @@ "ConfusionMatrixCell", "ConfusionMatrixRow", "CreateProjectOptions", - "DataGenerationConnectionInfo", - "DeploymentResource", "EntitiesEvaluationSummary", "EntityEvaluationSummary", "EvalSummary", @@ -87,7 +82,6 @@ "UtteranceEntityEvaluationResult", "UtteranceEvaluationResult", "UtteranceIntentsEvaluationResult", - "DataGenerationConnectionKind", "EvaluationKind", "OperationStatus", "ProjectKind", 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 a05f16c35078..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 @@ -9,7 +9,7 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from azure.core.exceptions import ODataV4Format @@ -21,23 +21,23 @@ class AssignDeploymentResourcesDetails(_Model): - """Represents the options for assigning Azure resources to a project. + """Represents the payload for assigning Azure resources to a project. - :ivar metadata: Represents the metadata for the resources to be assigned. Required. + :ivar metadata: Represents the metadata for the project resources to be assigned. Required. :vartype metadata: list[~azure.ai.language.conversations.authoring.models._models.ResourceMetadata] """ - metadata: List["_models._models.ResourceMetadata"] = rest_field( - name="resourcesMetadata", visibility=["read", "create", "update", "delete", "query"] + metadata: list["_models._models.ResourceMetadata"] = rest_field( + name="projectResources", visibility=["read", "create", "update", "delete", "query"] ) - """Represents the metadata for the resources to be assigned. Required.""" + """Represents the metadata for the project resources to be assigned. Required.""" @overload def __init__( self, *, - metadata: List["_models._models.ResourceMetadata"], + metadata: list["_models._models.ResourceMetadata"], ) -> None: ... @overload @@ -52,18 +52,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AssignedDeploymentResource(_Model): - """Represents the assigned deployment resource. + """Represents the assigned project resource. - :ivar resource_id: The resource ID. Required. + :ivar resource_id: The Azure resource ID of the language or AI resource. Required. :vartype resource_id: str - :ivar region: The resource region. Required. + :ivar region: The Azure resource region. Required. :vartype region: str """ resource_id: str = rest_field(name="azureResourceId", visibility=["read"]) - """The resource ID. Required.""" + """The Azure resource ID of the language or AI resource. Required.""" region: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource region. Required.""" + """The Azure resource region. Required.""" @overload def __init__( @@ -137,7 +137,7 @@ class AssignedProjectDeploymentsMetadata(_Model): project_name: str = rest_field(name="projectName", visibility=["read"]) """Represents the project name. Required.""" - deployments_metadata: List["_models.AssignedProjectDeploymentMetadata"] = rest_field( + deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"] = rest_field( name="deploymentsMetadata", visibility=["read", "create", "update", "delete", "query"] ) """Represents the resource region. Required.""" @@ -146,7 +146,7 @@ class AssignedProjectDeploymentsMetadata(_Model): def __init__( self, *, - deployments_metadata: List["_models.AssignedProjectDeploymentMetadata"], + deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"], ) -> None: ... @overload @@ -265,7 +265,7 @@ class ConversationExportedEntity(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The list component of the entity.""" - prebuilts: Optional[List["_models._models.ExportedPrebuiltEntity"]] = rest_field( + prebuilts: Optional[list["_models._models.ExportedPrebuiltEntity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The prebuilt entities components.""" @@ -273,7 +273,7 @@ class ConversationExportedEntity(_Model): visibility=["read", "create", "update", "delete", "query"] ) """The regex component of the entity.""" - required_components: Optional[List[str]] = rest_field( + required_components: Optional[list[str]] = rest_field( name="requiredComponents", visibility=["read", "create", "update", "delete", "query"] ) """The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'.""" @@ -286,9 +286,9 @@ def __init__( description: Optional[str] = None, composition_mode: Optional[Union[str, "_models._enums.CompositionMode"]] = None, entities: Optional["_models._models.ExportedEntityList"] = None, - prebuilts: Optional[List["_models._models.ExportedPrebuiltEntity"]] = None, + prebuilts: Optional[list["_models._models.ExportedPrebuiltEntity"]] = None, regex: Optional["_models._models.ExportedEntityRegex"] = None, - required_components: Optional[List[str]] = None, + required_components: Optional[list[str]] = None, ) -> None: ... @overload @@ -318,7 +318,7 @@ class ConversationExportedIntent(_Model): """The intent category. Required.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The intent description.""" - associated_entities: Optional[List["_models._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.""" @@ -329,7 +329,7 @@ def __init__( *, category: str, description: Optional[str] = None, - associated_entities: Optional[List["_models._models.ConversationExportedAssociatedEntityLabel"]] = None, + associated_entities: Optional[list["_models._models.ConversationExportedAssociatedEntityLabel"]] = None, ) -> None: ... @overload @@ -354,7 +354,7 @@ class ExportedProjectAsset(_Model): :vartype project_kind: str or ~azure.ai.language.conversations.authoring.models.ProjectKind """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} project_kind: str = rest_discriminator( name="projectKind", visibility=["read", "create", "update", "delete", "query"] ) @@ -396,15 +396,15 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv :vartype project_kind: str or ~azure.ai.language.conversations.authoring.models.CONVERSATION """ - intents: Optional[List["_models._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._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._models.ConversationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models._models.ConversationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The utterances defined in the project.""" @@ -416,9 +416,9 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv def __init__( self, *, - intents: Optional[List["_models._models.ConversationExportedIntent"]] = None, - entities: Optional[List["_models._models.ConversationExportedEntity"]] = None, - utterances: Optional[List["_models._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 @@ -429,7 +429,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, project_kind=ProjectKind.CONVERSATION, **kwargs) + super().__init__(*args, **kwargs) + self.project_kind = ProjectKind.CONVERSATION # type: ignore class ConversationExportedUtterance(_Model): @@ -450,7 +451,7 @@ class ConversationExportedUtterance(_Model): :vartype dataset: str or ~azure.ai.language.conversations.authoring.models.DatasetType """ - entities: Optional[List["_models._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.""" @@ -473,7 +474,7 @@ def __init__( *, text: str, intent: str, - entities: Optional[List["_models._models.ExportedUtteranceEntityLabel"]] = None, + entities: Optional[list["_models._models.ExportedUtteranceEntityLabel"]] = None, language: Optional[str] = None, dataset: Optional[Union[str, "_models._enums.DatasetType"]] = None, ) -> None: ... @@ -593,9 +594,9 @@ class CopyProjectState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -606,8 +607,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -630,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 @@ -649,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 @@ -747,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. @@ -764,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: ... @@ -789,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.""" @@ -806,7 +807,7 @@ def __init__( self, *, enable_data_generation: bool, - data_generation_connection_info: "_models.DataGenerationConnectionInfo", + data_generation_connection_info: "_models._models.DataGenerationConnectionInfo", ) -> None: ... @overload @@ -821,27 +822,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class DeleteDeploymentDetails(_Model): - """Represents the options for deleting a project deployment. + """Represents the payload for deleting a project deployment. - :ivar assigned_resource_ids: Represents the resource IDs to delete the deployment from. If not - provided, the deployment will be rolled out from all the resources it is deployed to. If - provided, it will delete the deployment only from the specified assigned resources, and leave - it for the rest. + :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( + assigned_resource_ids: Optional[list[str]] = rest_field( name="assignedResourceIds", visibility=["read", "create", "update", "delete", "query"] ) - """Represents the resource IDs to delete the deployment from. If not provided, the deployment will - be rolled out from all the resources it is deployed to. If provided, it will delete the - deployment only from the specified assigned resources, and leave it for the rest.""" + """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, + assigned_resource_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -894,9 +892,9 @@ class DeploymentDeleteFromResourcesState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -907,8 +905,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -931,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.""" @@ -949,7 +947,7 @@ def __init__( *, resource_id: str, region: str, - assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = None, + assigned_aoai_resource: Optional["_models._models.DataGenerationConnectionInfo"] = None, ) -> None: ... @overload @@ -964,7 +962,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class DeploymentResourcesState(_Model): - """Represents the state of a deployment resources job. + """Represents the state of a project resources job. :ivar job_id: The job ID. Required. :vartype job_id: str @@ -1002,9 +1000,9 @@ class DeploymentResourcesState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -1015,8 +1013,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -1069,9 +1067,9 @@ class DeploymentState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -1082,8 +1080,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -1128,12 +1126,12 @@ class EntitiesEvaluationSummary(_Model): :vartype macro_recall: float """ - confusion_matrix: Dict[str, "_models.ConfusionMatrixRow"] = rest_field( + confusion_matrix: dict[str, "_models.ConfusionMatrixRow"] = rest_field( name="confusionMatrix", visibility=["read", "create", "update", "delete", "query"] ) """Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. Required.""" - entities: Dict[str, "_models.EntityEvaluationSummary"] = rest_field( + entities: dict[str, "_models.EntityEvaluationSummary"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the entities evaluation summary. Required.""" @@ -1158,8 +1156,8 @@ class EntitiesEvaluationSummary(_Model): def __init__( self, *, - confusion_matrix: Dict[str, "_models.ConfusionMatrixRow"], - entities: Dict[str, "_models.EntityEvaluationSummary"], + confusion_matrix: dict[str, "_models.ConfusionMatrixRow"], + entities: dict[str, "_models.EntityEvaluationSummary"], micro_f1: float, micro_precision: float, micro_recall: float, @@ -1433,9 +1431,9 @@ class EvaluationState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" result: "_models._models.EvaluationJobResult" = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -1451,8 +1449,8 @@ def __init__( status: Union[str, "_models.OperationStatus"], result: "_models._models.EvaluationJobResult", expires_on: Optional[datetime.datetime] = None, - warnings: Optional[List[ODataV4Format]] = None, - errors: Optional[List[ODataV4Format]] = None, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -1512,7 +1510,7 @@ class ExportedOrchestrationDetails(_Model): ~azure.ai.language.conversations.authoring.models.OrchestrationTargetProjectKind """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} target_project_kind: str = rest_discriminator( name="targetProjectKind", visibility=["read", "create", "update", "delete", "query"] ) @@ -1569,7 +1567,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, target_project_kind=OrchestrationTargetProjectKind.CONVERSATION, **kwargs) + super().__init__(*args, **kwargs) + self.target_project_kind = OrchestrationTargetProjectKind.CONVERSATION # type: ignore class ExportedEntityList(_Model): @@ -1580,7 +1579,7 @@ class ExportedEntityList(_Model): list[~azure.ai.language.conversations.authoring.models._models.ExportedEntitySublist] """ - sublists: Optional[List["_models._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.""" @@ -1589,7 +1588,7 @@ class ExportedEntityList(_Model): def __init__( self, *, - sublists: Optional[List["_models._models.ExportedEntitySublist"]] = None, + sublists: Optional[list["_models._models.ExportedEntitySublist"]] = None, ) -> None: ... @overload @@ -1616,7 +1615,7 @@ class ExportedEntityListSynonym(_Model): language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.""" - synonyms: Optional[List[str]] = rest_field( + synonyms: Optional[list[str]] = rest_field( name="values", visibility=["read", "create", "update", "delete", "query"] ) """The list of synonyms.""" @@ -1626,7 +1625,7 @@ def __init__( self, *, language: Optional[str] = None, - synonyms: Optional[List[str]] = None, + synonyms: Optional[list[str]] = None, ) -> None: ... @overload @@ -1651,7 +1650,7 @@ class ExportedEntityRegex(_Model): list[~azure.ai.language.conversations.authoring.models._models.ExportedEntityRegexExpression] """ - expressions: Optional[List["_models._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. @@ -1663,7 +1662,7 @@ class ExportedEntityRegex(_Model): def __init__( self, *, - expressions: Optional[List["_models._models.ExportedEntityRegexExpression"]] = None, + expressions: Optional[list["_models._models.ExportedEntityRegexExpression"]] = None, ) -> None: ... @overload @@ -1735,7 +1734,7 @@ class ExportedEntitySublist(_Model): list_key: Optional[str] = rest_field(name="listKey", visibility=["read", "create", "update", "delete", "query"]) """The key of the sub-list.""" - synonyms: Optional[List["_models._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.""" @@ -1745,7 +1744,7 @@ def __init__( self, *, list_key: Optional[str] = None, - synonyms: Optional[List["_models._models.ExportedEntityListSynonym"]] = None, + synonyms: Optional[list["_models._models.ExportedEntityListSynonym"]] = None, ) -> None: ... @overload @@ -1831,7 +1830,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, target_project_kind=OrchestrationTargetProjectKind.LUIS, **kwargs) + super().__init__(*args, **kwargs) + self.target_project_kind = OrchestrationTargetProjectKind.LUIS # type: ignore class ExportedModelDetails(_Model): @@ -1903,9 +1903,9 @@ class ExportedModelState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -1916,8 +1916,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -2077,7 +2077,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, target_project_kind=OrchestrationTargetProjectKind.QUESTION_ANSWERING, **kwargs) + super().__init__(*args, **kwargs) + self.target_project_kind = OrchestrationTargetProjectKind.QUESTION_ANSWERING # type: ignore class ExportedTrainedModel(_Model): @@ -2219,9 +2220,9 @@ class ExportProjectState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" result_uri: Optional[str] = rest_field(name="resultUrl", visibility=["read", "create", "update", "delete", "query"]) """The URL to use in order to download the exported project.""" @@ -2234,8 +2235,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, result_uri: Optional[str] = None, ) -> None: ... @@ -2289,9 +2290,9 @@ class ImportProjectState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -2302,8 +2303,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -2414,12 +2415,12 @@ class IntentsEvaluationSummary(_Model): :vartype macro_recall: float """ - confusion_matrix: Dict[str, "_models.ConfusionMatrixRow"] = rest_field( + confusion_matrix: dict[str, "_models.ConfusionMatrixRow"] = rest_field( name="confusionMatrix", visibility=["read", "create", "update", "delete", "query"] ) """Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. Required.""" - intents: Dict[str, "_models.IntentEvaluationSummary"] = rest_field( + intents: dict[str, "_models.IntentEvaluationSummary"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the intents evaluation summary. Required.""" @@ -2444,8 +2445,8 @@ class IntentsEvaluationSummary(_Model): def __init__( self, *, - confusion_matrix: Dict[str, "_models.ConfusionMatrixRow"], - intents: Dict[str, "_models.IntentEvaluationSummary"], + confusion_matrix: dict[str, "_models.ConfusionMatrixRow"], + intents: dict[str, "_models.IntentEvaluationSummary"], micro_f1: float, micro_precision: float, micro_recall: float, @@ -2504,9 +2505,9 @@ class LoadSnapshotState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -2517,8 +2518,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -2588,11 +2589,11 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc :vartype project_kind: str or ~azure.ai.language.conversations.authoring.models.ORCHESTRATION """ - intents: Optional[List["_models._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._models.OrchestrationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the utterances of the project.""" @@ -2604,8 +2605,8 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc def __init__( self, *, - intents: Optional[List["_models._models.OrchestrationExportedIntent"]] = None, - utterances: Optional[List["_models._models.OrchestrationExportedUtterance"]] = None, + intents: Optional[list["_models._models.OrchestrationExportedIntent"]] = None, + utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = None, ) -> None: ... @overload @@ -2616,7 +2617,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, project_kind=ProjectKind.ORCHESTRATION, **kwargs) + super().__init__(*args, **kwargs) + self.project_kind = ProjectKind.ORCHESTRATION # type: ignore class OrchestrationExportedUtterance(_Model): @@ -2740,9 +2742,9 @@ class ProjectDeletionState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -2753,8 +2755,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -2785,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.DeploymentResource] + list[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] """ deployment_name: str = rest_field(name="deploymentName", visibility=["read"]) @@ -2808,7 +2810,7 @@ class ProjectDeployment(_Model): name="modelTrainingConfigVersion", visibility=["read", "create", "update", "delete", "query"] ) """Represents model training config version. Required.""" - assigned_resources: List["_models.DeploymentResource"] = 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.""" @@ -2822,7 +2824,7 @@ def __init__( last_deployed_on: datetime.datetime, deployment_expired_on: datetime.date, model_training_config_version: str, - assigned_resources: List["_models.DeploymentResource"], + assigned_resources: list["_models.AssignedDeploymentResource"], ) -> None: ... @overload @@ -3234,9 +3236,9 @@ class SwapDeploymentsState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" @overload @@ -3247,8 +3249,8 @@ def __init__( 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, + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -3474,9 +3476,9 @@ class TrainingState(_Model): ) """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"]) + 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"]) + errors: Optional[list[ODataV4Format]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The errors encountered while executing the job.""" result: "_models.TrainingJobResult" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Represents training tasks detailed result. Required.""" @@ -3490,38 +3492,8 @@ def __init__( status: Union[str, "_models.OperationStatus"], result: "_models.TrainingJobResult", 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 UnassignDeploymentResourcesDetails(_Model): - """Represents the options to unassign Azure resources from a project. - - :ivar assigned_resource_ids: Represents the assigned resource IDs to be unassigned. Required. - :vartype assigned_resource_ids: list[str] - """ - - assigned_resource_ids: List[str] = rest_field( - name="assignedResourceIds", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the assigned resource IDs to be unassigned. Required.""" - - @overload - def __init__( - self, - *, - assigned_resource_ids: List[str], + warnings: Optional[list[ODataV4Format]] = None, + errors: Optional[list[ODataV4Format]] = None, ) -> None: ... @overload @@ -3546,11 +3518,11 @@ class UtteranceEntitiesEvaluationResult(_Model): list[~azure.ai.language.conversations.authoring.models.UtteranceEntityEvaluationResult] """ - expected_entities: List["_models.UtteranceEntityEvaluationResult"] = rest_field( + expected_entities: list["_models.UtteranceEntityEvaluationResult"] = rest_field( name="expectedEntities", visibility=["read", "create", "update", "delete", "query"] ) """Represents the expected entity labels. Required.""" - predicted_entities: List["_models.UtteranceEntityEvaluationResult"] = rest_field( + predicted_entities: list["_models.UtteranceEntityEvaluationResult"] = rest_field( name="predictedEntities", visibility=["read", "create", "update", "delete", "query"] ) """Represents the predicted entity labels. Required.""" @@ -3559,8 +3531,8 @@ class UtteranceEntitiesEvaluationResult(_Model): def __init__( self, *, - expected_entities: List["_models.UtteranceEntityEvaluationResult"], - predicted_entities: List["_models.UtteranceEntityEvaluationResult"], + expected_entities: list["_models.UtteranceEntityEvaluationResult"], + predicted_entities: list["_models.UtteranceEntityEvaluationResult"], ) -> 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 f140af6701f0..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,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,342 +7,9 @@ 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 ( - AssignDeploymentResourcesDetails, - CopyProjectDetails, - CopyProjectState, - ConversationExportedEntity, - ConversationExportedIntent, - ConversationExportedProjectAsset, - ConversationExportedUtterance, - CreateDeploymentDetails, - DeleteDeploymentDetails, - DeploymentDeleteFromResourcesState, - DeploymentResourcesState, - DeploymentState, - EvaluationJobResult, - EvaluationState, - ExportProjectState, - ExportedModelDetails, - ExportedModelState, - ExportedProject, - ExportedUtteranceEntityLabel, - ImportProjectState, - LoadSnapshotState, - ProjectDeletionState, - ResourceMetadata, - SwapDeploymentsDetails, - SwapDeploymentsState, - TrainingJobDetails, - UnassignDeploymentResourcesDetails, -) - -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(): @@ -353,38 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = [ - "AssignDeploymentResourcesDetails", - "UnassignDeploymentResourcesDetails", - "SwapDeploymentsDetails", - "DeploymentResourcesState", - "CopyProjectState", - "ExportProjectState", - "SwapDeploymentsState", - "DeploymentResourcesState", - "DeleteDeploymentDetails", - "CreateDeploymentDetails", - "DeploymentDeleteFromResourcesState", - "DeploymentState", - "ExportedModelDetails", - "ExportedModelState", - "LoadSnapshotState", - "DeploymentResourcesState", - "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/_deployment_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_deployment_op_patch.py deleted file mode 100644 index b2ead6979686..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_deployment_op_patch.py +++ /dev/null @@ -1,266 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from ..models import ( - CreateDeploymentDetails, - DeleteDeploymentDetails, - DeploymentDeleteFromResourcesState, - DeploymentState, - ProjectDeployment, -) -from ._operations import DeploymentOperations as DeploymentOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - -class DeploymentOperations(DeploymentOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @distributed_trace - def begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]: # type: ignore[override] - """Deletes a project deployment. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_delete_deployment( - project_name=self._project_name, deployment_name=deployment_name, **kwargs - ) - - @overload - def begin_delete_deployment_from_resources( - self, - deployment_name: str, - body: DeleteDeploymentDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails - :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: - """ - - @overload - def begin_delete_deployment_from_resources( - self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. 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: - """ - - @overload - def begin_delete_deployment_from_resources( - self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. 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: - """ - - @distributed_trace - def begin_delete_deployment_from_resources( - self, deployment_name: str, body: Union[DeleteDeploymentDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. - - :param deployment_name: The name of the specific deployment of the project to use. Required. - :type deployment_name: str - :param body: The options for deleting the deployment. Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_delete_deployment_from_resources( - project_name=self._project_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @overload - def begin_deploy_project( - self, - deployment_name: str, - body: 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: - """ - - @overload - 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: - """ - - @overload - 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: - """ - - @distributed_trace - def begin_deploy_project( - self, deployment_name: str, body: Union[CreateDeploymentDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.CreateDeploymentDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_deploy_project( - project_name=self._project_name, - deployment_name=deployment_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @distributed_trace - def get_deployment(self, deployment_name: str, **kwargs: Any) -> ProjectDeployment: # type: ignore[override] - """Gets the details of a deployment. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :return: ProjectDeployment. The ProjectDeployment is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeployment - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_deployment(project_name=self._project_name, deployment_name=deployment_name, **kwargs) - - @distributed_trace - def _get_deployment_delete_from_resources_status( # type: ignore[override] - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> DeploymentDeleteFromResourcesState: - """Gets the status of an existing delete deployment from specific resources job. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is - compatible with MutableMapping - :rtype: - ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_deployment_delete_from_resources_status( - project_name=self._project_name, deployment_name=deployment_name, job_id=job_id, **kwargs - ) - - @distributed_trace - def _get_deployment_status( # type: ignore[override] - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> DeploymentState: - """Gets the status of an existing deployment job. - - :param deployment_name: Represents deployment name. Required. - :type deployment_name: str - :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._models.DeploymentState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_deployment_status( - project_name=self._project_name, deployment_name=deployment_name, job_id=job_id, **kwargs - ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_exported_model_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_exported_model_op_patch.py deleted file mode 100644 index be9ad6e5c38b..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_exported_model_op_patch.py +++ /dev/null @@ -1,173 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from ..models import ( - ExportedModelDetails, - ExportedModelState, - ExportedTrainedModel, -) -from ._operations import ExportedModelOperations as ExportedModelOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - -class ExportedModelOperations(ExportedModelOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - def begin_create_or_update_exported_model( - self, - exported_model_name: str, - body: 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: - """ - - @overload - 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: - """ - - @overload - 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: - """ - - @distributed_trace - def begin_create_or_update_exported_model( - self, exported_model_name: str, body: Union[ExportedModelDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.ExportedModelDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_create_or_update_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - body=body, - content_type=content_type, - **kwargs, - ) - - @distributed_trace - 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. - :type exported_model_name: str - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_delete_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - **kwargs, - ) - - @distributed_trace - def get_exported_model( # type: ignore[override] - self, exported_model_name: str, **kwargs: Any - ) -> ExportedTrainedModel: - """Gets the details of an exported model. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :return: ExportedTrainedModel. The ExportedTrainedModel is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ExportedTrainedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_exported_model( - project_name=self._project_name, - exported_model_name=exported_model_name, - **kwargs, - ) - - @distributed_trace - def _get_exported_model_job_status( # type: ignore[override] - self, exported_model_name: str, job_id: str, **kwargs: Any - ) -> ExportedModelState: - """Gets the status for an existing job to create or update an exported model. - - :param exported_model_name: The exported model name. Required. - :type exported_model_name: str - :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._models.ExportedModelState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_exported_model_job_status( - project_name=self._project_name, - exported_model_name=exported_model_name, - job_id=job_id, - **kwargs, - ) 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 696f9a6ecff3..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,10 +6,10 @@ # 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, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -40,7 +40,7 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] _Unset: Any = object() _SERIALIZER = Serializer() @@ -53,7 +53,7 @@ def build_conversation_authoring_list_projects_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_conversation_authoring_list_supported_languages_request( # pylint: di _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_conversation_authoring_list_assigned_resource_deployments_request( # _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_conversation_authoring_list_supported_prebuilt_entities_request( # py _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_conversation_authoring_list_training_config_versions_request( # pylin _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +211,7 @@ def build_conversation_authoring_create_project_request( # pylint: disable=name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +239,7 @@ def build_conversation_authoring_get_project_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -264,7 +264,7 @@ def build_conversation_authoring_delete_project_request( # pylint: disable=name ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}" path_format_arguments = { @@ -285,7 +285,7 @@ def build_conversation_authoring_get_export_status_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +312,7 @@ def build_conversation_authoring_get_import_status_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,11 +333,11 @@ def build_conversation_authoring_get_import_status_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployment_get_deployment_request(project_name: str, deployment_name: str, **kwargs: Any) -> HttpRequest: +def build_deployment_get_deployment_request(deployment_name: str, project_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,12 +358,12 @@ def build_deployment_get_deployment_request(project_name: str, deployment_name: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_deployment_deploy_project_request(project_name: str, deployment_name: str, **kwargs: Any) -> HttpRequest: +def build_deployment_deploy_project_request(deployment_name: str, project_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}" path_format_arguments = { @@ -384,11 +384,11 @@ def build_deployment_deploy_project_request(project_name: str, deployment_name: def build_deployment_delete_deployment_request( # pylint: disable=name-too-long - project_name: str, deployment_name: str, **kwargs: Any + deployment_name: str, project_name: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}" path_format_arguments = { @@ -405,13 +405,13 @@ def build_deployment_delete_deployment_request( # pylint: disable=name-too-long def build_deployment_delete_deployment_from_resources_request( # pylint: disable=name-too-long - project_name: str, deployment_name: str, **kwargs: Any + deployment_name: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/:delete-from-resources" path_format_arguments = { @@ -432,12 +432,12 @@ def build_deployment_delete_deployment_from_resources_request( # pylint: disabl def build_deployment_get_deployment_delete_from_resources_status_request( # pylint: disable=name-too-long - project_name: str, deployment_name: str, job_id: str, **kwargs: Any + deployment_name: str, job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -460,12 +460,12 @@ def build_deployment_get_deployment_delete_from_resources_status_request( # pyl def build_deployment_get_deployment_status_request( # pylint: disable=name-too-long - project_name: str, deployment_name: str, job_id: str, **kwargs: Any + deployment_name: str, job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -498,7 +498,7 @@ def build_project_list_trained_models_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -535,7 +535,7 @@ def build_project_list_training_jobs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -572,7 +572,7 @@ def build_project_list_deployment_resources_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -609,7 +609,7 @@ def build_project_list_deployments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -646,7 +646,7 @@ def build_project_list_exported_models_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -679,7 +679,7 @@ def build_project_assign_deployment_resources_request( # pylint: disable=name-t _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/resources/:assign" path_format_arguments = { @@ -705,7 +705,7 @@ def build_project_unassign_deployment_resources_request( # pylint: disable=name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/resources/:unassign" path_format_arguments = { @@ -725,12 +725,12 @@ def build_project_unassign_deployment_resources_request( # pylint: disable=name def build_project_get_assign_deployment_resources_status_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -752,12 +752,12 @@ def build_project_get_assign_deployment_resources_status_request( # pylint: dis def build_project_get_unassign_deployment_resources_status_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -783,7 +783,7 @@ def build_project_swap_deployments_request(project_name: str, **kwargs: Any) -> _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/deployments/:swap" path_format_arguments = { @@ -803,12 +803,12 @@ def build_project_swap_deployments_request(project_name: str, **kwargs: Any) -> def build_project_get_swap_deployments_status_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -833,7 +833,7 @@ def build_project_get_project_request(project_name: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -859,7 +859,7 @@ def build_project_get_project_deletion_status_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -889,7 +889,7 @@ def build_project_import_method_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/:import" path_format_arguments = { @@ -921,7 +921,7 @@ def build_project_export_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/:export" path_format_arguments = { @@ -943,11 +943,11 @@ def build_project_export_request( return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_project_get_export_status_request(project_name: str, job_id: str, **kwargs: Any) -> HttpRequest: +def build_project_get_export_status_request(job_id: str, project_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -975,7 +975,7 @@ def build_project_copy_project_authorization_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1002,7 +1002,7 @@ def build_project_copy_project_request(project_name: str, **kwargs: Any) -> Http _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/:copy" path_format_arguments = { @@ -1022,12 +1022,12 @@ def build_project_copy_project_request(project_name: str, **kwargs: Any) -> Http def build_project_get_copy_project_status_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1053,7 +1053,7 @@ def build_project_train_request(project_name: str, **kwargs: Any) -> HttpRequest _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/:train" path_format_arguments = { @@ -1073,12 +1073,12 @@ def build_project_train_request(project_name: str, **kwargs: Any) -> HttpRequest def build_project_get_training_status_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1100,11 +1100,11 @@ def build_project_get_training_status_request( # pylint: disable=name-too-long def build_project_cancel_training_job_request( # pylint: disable=name-too-long - project_name: str, job_id: str, **kwargs: Any + job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/train/jobs/{jobId}/:cancel" path_format_arguments = { @@ -1121,12 +1121,12 @@ def build_project_cancel_training_job_request( # pylint: disable=name-too-long def build_exported_model_get_exported_model_request( # pylint: disable=name-too-long - project_name: str, exported_model_name: str, **kwargs: Any + exported_model_name: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1148,11 +1148,11 @@ def build_exported_model_get_exported_model_request( # pylint: disable=name-too def build_exported_model_delete_exported_model_request( # pylint: disable=name-too-long - project_name: str, exported_model_name: str, **kwargs: Any + exported_model_name: str, project_name: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/exported-models/{exportedModelName}" path_format_arguments = { @@ -1169,13 +1169,13 @@ def build_exported_model_delete_exported_model_request( # pylint: disable=name- def build_exported_model_create_or_update_exported_model_request( # pylint: disable=name-too-long - project_name: str, exported_model_name: str, **kwargs: Any + exported_model_name: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/exported-models/{exportedModelName}" path_format_arguments = { @@ -1196,12 +1196,12 @@ def build_exported_model_create_or_update_exported_model_request( # pylint: dis def build_exported_model_get_exported_model_job_status_request( # pylint: disable=name-too-long - project_name: str, exported_model_name: str, job_id: str, **kwargs: Any + exported_model_name: str, job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1224,12 +1224,12 @@ def build_exported_model_get_exported_model_job_status_request( # pylint: disab def build_trained_model_get_trained_model_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, **kwargs: Any + trained_model_label: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1251,11 +1251,11 @@ def build_trained_model_get_trained_model_request( # pylint: disable=name-too-l def build_trained_model_delete_trained_model_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, **kwargs: Any + trained_model_label: str, project_name: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}" path_format_arguments = { @@ -1272,13 +1272,13 @@ def build_trained_model_delete_trained_model_request( # pylint: disable=name-to def build_trained_model_evaluate_model_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, **kwargs: Any + trained_model_label: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/:evaluate" path_format_arguments = { @@ -1299,11 +1299,11 @@ def build_trained_model_evaluate_model_request( # pylint: disable=name-too-long def build_trained_model_load_snapshot_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, **kwargs: Any + trained_model_label: str, project_name: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) # Construct URL _url = "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/:load-snapshot" path_format_arguments = { @@ -1320,12 +1320,12 @@ def build_trained_model_load_snapshot_request( # pylint: disable=name-too-long def build_trained_model_get_evaluation_status_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + trained_model_label: str, job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1348,8 +1348,8 @@ def build_trained_model_get_evaluation_status_request( # pylint: disable=name-t def build_trained_model_get_model_evaluation_results_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, + project_name: str, *, string_index_type: Union[str, _models.StringIndexType], top: Optional[int] = None, @@ -1360,7 +1360,7 @@ def build_trained_model_get_model_evaluation_results_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1389,12 +1389,12 @@ def build_trained_model_get_model_evaluation_results_request( # pylint: disable def build_trained_model_get_model_evaluation_summary_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, **kwargs: Any + trained_model_label: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1418,12 +1418,12 @@ def build_trained_model_get_model_evaluation_summary_request( # pylint: disable def build_trained_model_get_load_snapshot_status_request( # pylint: disable=name-too-long - project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + trained_model_label: str, job_id: str, project_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-05-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1470,7 +1470,7 @@ def list_projects( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectDetails]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectDetails]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1522,7 +1522,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ProjectDetails], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectDetails], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1571,7 +1571,7 @@ def list_supported_languages( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.SupportedLanguage]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.SupportedLanguage]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1624,7 +1624,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SupportedLanguage], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.SupportedLanguage], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1648,9 +1648,9 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + params_added_on={"2025-11-01": ["api_version", "top", "skip", "maxpagesize", "accept"]}, + api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def list_assigned_resource_deployments( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any @@ -1672,7 +1672,7 @@ def list_assigned_resource_deployments( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.AssignedProjectDeploymentsMetadata]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedProjectDeploymentsMetadata]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1724,7 +1724,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.AssignedProjectDeploymentsMetadata], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedProjectDeploymentsMetadata], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1778,7 +1778,7 @@ def list_supported_prebuilt_entities( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.PrebuiltEntity]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.PrebuiltEntity]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1832,7 +1832,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PrebuiltEntity], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.PrebuiltEntity], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1881,7 +1881,7 @@ def list_training_config_versions( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.TrainingConfigVersion]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.TrainingConfigVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1934,7 +1934,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TrainingConfigVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.TrainingConfigVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2401,11 +2401,9 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> _models.ProjectDeployment: + def get_deployment(self, deployment_name: str, **kwargs: Any) -> _models.ProjectDeployment: """Gets the details of a deployment. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :return: ProjectDeployment. The ProjectDeployment is compatible with MutableMapping @@ -2426,8 +2424,8 @@ def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) cls: ClsType[_models.ProjectDeployment] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2464,11 +2462,7 @@ def get_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) return deserialized # type: ignore def _deploy_project_initial( - self, - project_name: str, - deployment_name: str, - body: Union[_models._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, @@ -2492,8 +2486,8 @@ def _deploy_project_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_deployment_deploy_project_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2533,7 +2527,6 @@ def _deploy_project_initial( @overload def _begin_deploy_project( self, - project_name: str, deployment_name: str, body: _models._models.CreateDeploymentDetails, *, @@ -2542,37 +2535,19 @@ def _begin_deploy_project( ) -> LROPoller[None]: ... @overload def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace def _begin_deploy_project( - self, - project_name: str, - deployment_name: str, - body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], - **kwargs: Any + 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. - :param project_name: The name of the project to use. Required. - :type project_name: str :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. Is one of the following types: CreateDeploymentDetails, @@ -2593,7 +2568,6 @@ def _begin_deploy_project( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._deploy_project_initial( - project_name=project_name, deployment_name=deployment_name, body=body, content_type=content_type, @@ -2630,7 +2604,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 - def _delete_deployment_initial(self, project_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_deployment_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2645,8 +2619,8 @@ def _delete_deployment_initial(self, project_name: str, deployment_name: str, ** cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_deployment_delete_deployment_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2682,11 +2656,9 @@ def _delete_deployment_initial(self, project_name: str, deployment_name: str, ** return deserialized # type: ignore @distributed_trace - def _begin_delete_deployment(self, project_name: str, deployment_name: str, **kwargs: Any) -> LROPoller[None]: + def _begin_delete_deployment(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]: """Deletes a project deployment. - :param project_name: The name of the project to use. Required. - :type project_name: str :param deployment_name: The name of the specific deployment of the project to use. Required. :type deployment_name: str :return: An instance of LROPoller that returns None @@ -2702,12 +2674,7 @@ def _begin_delete_deployment(self, project_name: str, deployment_name: str, **kw cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_deployment_initial( - project_name=project_name, - deployment_name=deployment_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + deployment_name=deployment_name, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -2738,16 +2705,12 @@ 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 @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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 _delete_deployment_from_resources_initial( # pylint: disable=name-too-long - self, - project_name: str, - deployment_name: str, - body: Union[_models._models.DeleteDeploymentDetails, 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, @@ -2771,8 +2734,8 @@ def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_deployment_delete_deployment_from_resources_request( - project_name=project_name, deployment_name=deployment_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2812,7 +2775,6 @@ def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long @overload def _begin_delete_deployment_from_resources( self, - project_name: str, deployment_name: str, body: _models._models.DeleteDeploymentDetails, *, @@ -2821,46 +2783,29 @@ def _begin_delete_deployment_from_resources( ) -> LROPoller[None]: ... @overload def _begin_delete_deployment_from_resources( - self, - project_name: str, - deployment_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_delete_deployment_from_resources( - self, - project_name: str, - deployment_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, deployment_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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, - project_name: str, - deployment_name: str, - body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], - **kwargs: Any + self, deployment_name: str, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Deletes a project deployment from the specified assigned resources. + """Deletes a deployment from the specified project-assigned resources. - :param project_name: The name of the project to use. Required. - :type project_name: str :param deployment_name: The name of the specific deployment of the project to use. Required. :type deployment_name: str - :param body: The options for deleting the deployment. Is one of the following types: - DeleteDeploymentDetails, JSON, IO[bytes] Required. + :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: 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 @@ -2877,7 +2822,6 @@ def _begin_delete_deployment_from_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_deployment_from_resources_initial( - project_name=project_name, deployment_name=deployment_name, body=body, content_type=content_type, @@ -2916,17 +2860,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "deployment_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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 - self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + self, deployment_name: str, job_id: str, **kwargs: Any ) -> _models._models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :param job_id: The job ID. Required. @@ -2951,9 +2893,9 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( - project_name=project_name, deployment_name=deployment_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2993,12 +2935,10 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo @distributed_trace def _get_deployment_status( - self, project_name: str, deployment_name: str, job_id: str, **kwargs: Any + self, deployment_name: str, job_id: str, **kwargs: Any ) -> _models._models.DeploymentState: """Gets the status of an existing deployment job. - :param project_name: The new project name. Required. - :type project_name: str :param deployment_name: Represents deployment name. Required. :type deployment_name: str :param job_id: The job ID. Required. @@ -3021,9 +2961,9 @@ def _get_deployment_status( cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( - project_name=project_name, deployment_name=deployment_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3083,12 +3023,10 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_trained_models( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.ProjectTrainedModel"]: """Lists the trained models belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -3102,7 +3040,7 @@ def list_trained_models( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectTrainedModel]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectTrainedModel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3116,7 +3054,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_trained_models_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -3155,7 +3093,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ProjectTrainedModel], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectTrainedModel], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3179,12 +3117,10 @@ def get_next(next_link=None): @distributed_trace def list_training_jobs( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.TrainingState"]: """Lists the non-expired training jobs created for a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -3198,7 +3134,7 @@ def list_training_jobs( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.TrainingState]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.TrainingState]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3212,7 +3148,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_training_jobs_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -3251,7 +3187,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.TrainingState], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.TrainingState], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3275,17 +3211,15 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.AssignedDeploymentResource"]: - """Lists the deployments resources assigned to the project. + """Lists the Language or AIService resources assigned to the project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -3299,7 +3233,7 @@ def list_deployment_resources( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3313,7 +3247,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -3352,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.AssignedDeploymentResource], 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) @@ -3376,12 +3310,10 @@ def get_next(next_link=None): @distributed_trace def list_deployments( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.ProjectDeployment"]: """Lists the deployments belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -3395,7 +3327,7 @@ def list_deployments( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ProjectDeployment]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ProjectDeployment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3409,7 +3341,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_deployments_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -3448,7 +3380,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ProjectDeployment], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ProjectDeployment], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3472,17 +3404,15 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + params_added_on={"2025-05-15-preview": ["api_version", "project_name", "top", "skip", "maxpagesize", "accept"]}, + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def list_exported_models( - self, project_name: str, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any + self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.ExportedTrainedModel"]: """Lists the exported models belonging to a project. - :param project_name: The new project name. Required. - :type project_name: str :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. @@ -3496,7 +3426,7 @@ def list_exported_models( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.ExportedTrainedModel]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.ExportedTrainedModel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3510,7 +3440,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_project_list_exported_models_request( - project_name=project_name, + project_name=self._config.project_name, top=top, skip=skip, maxpagesize=maxpagesize, @@ -3549,7 +3479,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ExportedTrainedModel], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.ExportedTrainedModel], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3572,15 +3502,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_initial( - self, - project_name: str, - body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3604,7 +3531,7 @@ def _assign_deployment_resources_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_assign_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3644,7 +3571,6 @@ def _assign_deployment_resources_initial( @overload def _begin_assign_deployment_resources( self, - project_name: str, body: _models._models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", @@ -3652,34 +3578,29 @@ def _begin_assign_deployment_resources( ) -> LROPoller[None]: ... @overload def _begin_assign_deployment_resources( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_assign_deployment_resources( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, - project_name: str, - body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: + """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 project_name: The name of the project to use. Required. - :type project_name: str - :param body: The new project resources info. Is one of the following types: + :param body: The new project resources to be assigned. Is one of the following types: AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. :type body: ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or @@ -3698,13 +3619,7 @@ def _begin_assign_deployment_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._assign_deployment_resources_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -3735,15 +3650,12 @@ 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 @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_initial( - self, - project_name: str, - body: Union[_models._models.UnassignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3767,7 +3679,7 @@ def _unassign_deployment_resources_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_unassign_deployment_resources_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3806,44 +3718,32 @@ def _unassign_deployment_resources_initial( @overload def _begin_unassign_deployment_resources( - self, - project_name: str, - body: _models._models.UnassignDeploymentResourcesDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_unassign_deployment_resources( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_unassign_deployment_resources( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources( - self, - project_name: str, - body: Union[_models._models.UnassignDeploymentResourcesDetails, JSON, IO[bytes]], - **kwargs: Any + self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. + """Unassign resources from a project. This disallows deployment to these resources. - :param project_name: The name of the project to use. Required. - :type project_name: str - :param body: The info for the deployment resources to be deleted. Is one of the following - types: UnassignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: - ~azure.ai.language.conversations.authoring.models._models.UnassignDeploymentResourcesDetails or - JSON or IO[bytes] + :param body: The list of Language or AIService Azure resource IDs to be unassigned. 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: @@ -3858,13 +3758,7 @@ def _begin_unassign_deployment_resources( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._unassign_deployment_resources_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -3896,17 +3790,15 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_status( - self, project_name: str, job_id: str, **kwargs: Any + self, job_id: str, **kwargs: Any ) -> _models._models.DeploymentResourcesState: - """Gets the status of an existing assign deployment resources job. + """Gets the status of an existing assign project resources job. - :param project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with @@ -3928,8 +3820,8 @@ def _get_assign_deployment_resources_status( cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_deployment_resources_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3969,17 +3861,15 @@ def _get_assign_deployment_resources_status( @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-11-01", + 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_deployment_resources_status( # pylint: disable=name-too-long - self, project_name: str, job_id: str, **kwargs: Any + self, job_id: str, **kwargs: Any ) -> _models._models.DeploymentResourcesState: - """Gets the status of an existing unassign deployment resources job. + """Gets the status of an existing unassign project resources job. - :param project_name: The name of the project to use. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with @@ -4001,8 +3891,8 @@ def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_deployment_resources_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4041,7 +3931,7 @@ def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long return deserialized # type: ignore def _swap_deployments_initial( - self, project_name: str, body: Union[_models._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, @@ -4065,7 +3955,7 @@ def _swap_deployments_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_swap_deployments_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4104,30 +3994,23 @@ def _swap_deployments_initial( @overload def _begin_swap_deployments( - self, - project_name: str, - body: _models._models.SwapDeploymentsDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_swap_deployments( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_swap_deployments( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace def _begin_swap_deployments( - self, project_name: str, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Swaps two existing deployments with each other. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.SwapDeploymentsDetails or @@ -4146,13 +4029,7 @@ def _begin_swap_deployments( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._swap_deployments_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -4183,13 +4060,9 @@ 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, project_name: str, job_id: str, **kwargs: Any - ) -> _models._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: SwapDeploymentsState. The SwapDeploymentsState is compatible with MutableMapping @@ -4210,8 +4083,8 @@ def _get_swap_deployments_status( cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4250,11 +4123,9 @@ def _get_swap_deployments_status( return deserialized # type: ignore @distributed_trace - def _get_project(self, project_name: str, **kwargs: Any) -> _models.ProjectDetails: + def _get_project(self, **kwargs: Any) -> _models.ProjectDetails: """Gets the details of a project. - :param project_name: The new project name. Required. - :type project_name: str :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -4273,7 +4144,7 @@ def _get_project(self, project_name: str, **kwargs: Any) -> _models.ProjectDetai cls: ClsType[_models.ProjectDetails] = kwargs.pop("cls", None) _request = build_project_get_project_request( - project_name=project_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4373,7 +4244,6 @@ def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._m def _import_method_initial( self, - project_name: str, body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4401,7 +4271,7 @@ def _import_method_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_import_method_request( - project_name=project_name, + project_name=self._config.project_name, exported_project_format=exported_project_format, content_type=content_type, api_version=self._config.api_version, @@ -4442,7 +4312,6 @@ def _import_method_initial( @overload def _begin_import_method( self, - project_name: str, body: _models._models.ExportedProject, *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4452,7 +4321,6 @@ def _begin_import_method( @overload def _begin_import_method( self, - project_name: str, body: JSON, *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4462,7 +4330,6 @@ def _begin_import_method( @overload def _begin_import_method( self, - project_name: str, body: IO[bytes], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4473,7 +4340,6 @@ def _begin_import_method( @distributed_trace def _begin_import_method( self, - project_name: str, body: Union[_models._models.ExportedProject, JSON, IO[bytes]], *, exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4482,8 +4348,6 @@ def _begin_import_method( """Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.ExportedProject or JSON @@ -4506,7 +4370,6 @@ def _begin_import_method( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._import_method_initial( - project_name=project_name, body=body, exported_project_format=exported_project_format, content_type=content_type, @@ -4545,7 +4408,6 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _export_initial( self, - project_name: str, *, string_index_type: Union[str, _models.StringIndexType], exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4567,7 +4429,7 @@ def _export_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_project_export_request( - project_name=project_name, + project_name=self._config.project_name, string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, @@ -4609,7 +4471,6 @@ def _export_initial( @distributed_trace def _begin_export( self, - project_name: str, *, string_index_type: Union[str, _models.StringIndexType], exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, @@ -4619,8 +4480,6 @@ def _begin_export( ) -> LROPoller[None]: """Triggers a job to export a project's data. - :param project_name: The name of the project to use. Required. - :type project_name: str :keyword string_index_type: Specifies the method used to interpret string offsets. For additional information see `https://aka.ms/text-analytics-offsets `_. Known values are: "Utf16CodeUnit", "Utf8CodeUnit", @@ -4649,7 +4508,6 @@ def _begin_export( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._export_initial( - project_name=project_name, string_index_type=string_index_type, exported_project_format=exported_project_format, asset_kind=asset_kind, @@ -4688,11 +4546,9 @@ 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._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: ExportProjectState. The ExportProjectState is compatible with MutableMapping @@ -4713,8 +4569,8 @@ def _get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _ cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4755,7 +4611,6 @@ def _get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _ @overload def _copy_project_authorization( self, - project_name: str, *, project_kind: Union[str, _models.ProjectKind], content_type: str = "application/json", @@ -4765,22 +4620,21 @@ def _copy_project_authorization( ) -> _models._models.CopyProjectDetails: ... @overload def _copy_project_authorization( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models._models.CopyProjectDetails: ... @overload def _copy_project_authorization( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models._models.CopyProjectDetails: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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( self, - project_name: str, body: Union[JSON, IO[bytes]] = _Unset, *, project_kind: Union[str, _models.ProjectKind] = _Unset, @@ -4790,8 +4644,6 @@ def _copy_project_authorization( ) -> _models._models.CopyProjectDetails: """Generates a copy project operation authorization to the current target Azure resource. - :param project_name: The new project name. Required. - :type project_name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword project_kind: Represents the project kind. Known values are: "Conversation", @@ -4838,7 +4690,7 @@ def _copy_project_authorization( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_copy_project_authorization_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4879,12 +4731,12 @@ def _copy_project_authorization( return deserialized # type: ignore @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _copy_project_initial( - self, project_name: str, body: Union[_models._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, @@ -4908,7 +4760,7 @@ def _copy_project_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_copy_project_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4947,35 +4799,28 @@ def _copy_project_initial( @overload def _begin_copy_project( - self, - project_name: str, - body: _models._models.CopyProjectDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_copy_project( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_copy_project( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Copies an existing project to another Azure resource. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.CopyProjectDetails or @@ -4994,13 +4839,7 @@ def _begin_copy_project( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._copy_project_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -5032,17 +4871,13 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "job_id", "accept"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, job_id: str, **kwargs: Any - ) -> _models._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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: CopyProjectState. The CopyProjectState is compatible with MutableMapping @@ -5063,8 +4898,8 @@ def _get_copy_project_status( cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5103,7 +4938,7 @@ def _get_copy_project_status( return deserialized # type: ignore def _train_initial( - self, project_name: str, body: Union[_models._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, @@ -5127,7 +4962,7 @@ def _train_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_project_train_request( - project_name=project_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5166,30 +5001,23 @@ def _train_initial( @overload def _begin_train( - self, - project_name: str, - body: _models._models.TrainingJobDetails, - *, - content_type: str = "application/json", - **kwargs: Any + self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.TrainingJobResult]: ... @overload def _begin_train( - self, project_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.TrainingJobResult]: ... @overload def _begin_train( - self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.TrainingJobResult]: ... @distributed_trace def _begin_train( - self, project_name: str, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.TrainingJobResult]: """Triggers a training job for a project. - :param project_name: The name of the project to use. Required. - :type project_name: str :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._models.TrainingJobDetails or @@ -5210,13 +5038,7 @@ def _begin_train( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._train_initial( - project_name=project_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -5257,11 +5079,9 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def _get_training_status(self, project_name: str, 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 project_name: The new project name. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: TrainingState. The TrainingState is compatible with MutableMapping @@ -5282,8 +5102,8 @@ def _get_training_status(self, project_name: str, job_id: str, **kwargs: Any) -> cls: ClsType[_models.TrainingState] = kwargs.pop("cls", None) _request = build_project_get_training_status_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5319,7 +5139,7 @@ def _get_training_status(self, project_name: str, job_id: str, **kwargs: Any) -> return deserialized # type: ignore - def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: Any) -> Iterator[bytes]: + def _cancel_training_job_initial(self, job_id: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5334,8 +5154,8 @@ def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_project_cancel_training_job_request( - project_name=project_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5371,13 +5191,9 @@ def _cancel_training_job_initial(self, project_name: str, job_id: str, **kwargs: return deserialized # type: ignore @distributed_trace - def _begin_cancel_training_job( - self, project_name: str, job_id: str, **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: + def begin_cancel_training_job(self, job_id: str, **kwargs: Any) -> LROPoller[_models.TrainingJobResult]: """Triggers a cancellation for a running training job. - :param project_name: The name of the project to use. Required. - :type project_name: str :param job_id: The job ID. Required. :type job_id: str :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is @@ -5395,12 +5211,7 @@ def _begin_cancel_training_job( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._cancel_training_job_initial( - project_name=project_name, - job_id=job_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + job_id=job_id, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) @@ -5462,17 +5273,13 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "accept"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + params_added_on={"2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "accept"]}, + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) - def get_exported_model( - self, project_name: str, exported_model_name: str, **kwargs: Any - ) -> _models.ExportedTrainedModel: + def get_exported_model(self, exported_model_name: str, **kwargs: Any) -> _models.ExportedTrainedModel: """Gets the details of an exported model. - :param project_name: The new project name. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :return: ExportedTrainedModel. The ExportedTrainedModel is compatible with MutableMapping @@ -5493,8 +5300,8 @@ def get_exported_model( cls: ClsType[_models.ExportedTrainedModel] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5531,13 +5338,11 @@ def get_exported_model( return deserialized # type: ignore @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _delete_exported_model_initial( - self, project_name: str, exported_model_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def _delete_exported_model_initial(self, exported_model_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5552,8 +5357,8 @@ def _delete_exported_model_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_exported_model_delete_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5590,17 +5395,13 @@ def _delete_exported_model_initial( @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, project_name: str, 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 project_name: The name of the project to use. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :return: An instance of LROPoller that returns None @@ -5616,7 +5417,6 @@ def _begin_delete_exported_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_exported_model_initial( - project_name=project_name, exported_model_name=exported_model_name, cls=lambda x, y, z: x, headers=_headers, @@ -5652,13 +5452,12 @@ 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 @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _create_or_update_exported_model_initial( self, - project_name: str, exported_model_name: str, body: Union[_models._models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any @@ -5685,8 +5484,8 @@ def _create_or_update_exported_model_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_exported_model_create_or_update_exported_model_request( - project_name=project_name, exported_model_name=exported_model_name, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5726,7 +5525,6 @@ def _create_or_update_exported_model_initial( @overload def _begin_create_or_update_exported_model( self, - project_name: str, exported_model_name: str, body: _models._models.ExportedModelDetails, *, @@ -5735,42 +5533,27 @@ def _begin_create_or_update_exported_model( ) -> LROPoller[None]: ... @overload def _begin_create_or_update_exported_model( - self, - project_name: str, - exported_model_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, exported_model_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def _begin_create_or_update_exported_model( - self, - project_name: str, - exported_model_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, exported_model_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", - params_added_on={"2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "content_type"]}, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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, - project_name: str, 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. - :param project_name: The name of the project to use. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :param body: The exported model info. Is one of the following types: ExportedModelDetails, @@ -5791,7 +5574,6 @@ def _begin_create_or_update_exported_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_or_update_exported_model_initial( - project_name=project_name, exported_model_name=exported_model_name, body=body, content_type=content_type, @@ -5830,19 +5612,17 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2024-11-15-preview", + method_added_on="2025-05-15-preview", params_added_on={ - "2024-11-15-preview": ["api_version", "project_name", "exported_model_name", "job_id", "accept"] + "2025-05-15-preview": ["api_version", "project_name", "exported_model_name", "job_id", "accept"] }, - api_versions_list=["2024-11-15-preview", "2025-05-15-preview"], + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def _get_exported_model_job_status( - self, project_name: str, exported_model_name: str, job_id: str, **kwargs: Any + self, exported_model_name: str, job_id: str, **kwargs: Any ) -> _models._models.ExportedModelState: """Gets the status for an existing job to create or update an exported model. - :param project_name: The new project name. Required. - :type project_name: str :param exported_model_name: The exported model name. Required. :type exported_model_name: str :param job_id: The job ID. Required. @@ -5865,9 +5645,9 @@ def _get_exported_model_job_status( cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( - project_name=project_name, exported_model_name=exported_model_name, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5926,13 +5706,9 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_trained_model( - self, project_name: str, trained_model_label: str, **kwargs: Any - ) -> _models.ProjectTrainedModel: + def get_trained_model(self, trained_model_label: str, **kwargs: Any) -> _models.ProjectTrainedModel: """Gets the details of a trained model. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: ProjectTrainedModel. The ProjectTrainedModel is compatible with MutableMapping @@ -5953,8 +5729,8 @@ def get_trained_model( cls: ClsType[_models.ProjectTrainedModel] = kwargs.pop("cls", None) _request = build_trained_model_get_trained_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5992,12 +5768,10 @@ def get_trained_model( @distributed_trace def delete_trained_model( # pylint: disable=inconsistent-return-statements - self, project_name: str, trained_model_label: str, **kwargs: Any + self, trained_model_label: str, **kwargs: Any ) -> None: """Deletes an existing trained model. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: None @@ -6018,8 +5792,8 @@ def delete_trained_model( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) _request = build_trained_model_delete_trained_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6044,16 +5818,12 @@ def delete_trained_model( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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 _evaluate_model_initial( - self, - project_name: str, - trained_model_label: str, - body: Union[_models.EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any + self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6077,8 +5847,8 @@ def _evaluate_model_initial( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_trained_model_evaluate_model_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6118,7 +5888,6 @@ def _evaluate_model_initial( @overload def _begin_evaluate_model( self, - project_name: str, trained_model_label: str, body: _models.EvaluationDetails, *, @@ -6127,42 +5896,24 @@ def _begin_evaluate_model( ) -> LROPoller[_models._models.EvaluationJobResult]: ... @overload def _begin_evaluate_model( - self, - project_name: str, - trained_model_label: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any + self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models._models.EvaluationJobResult]: ... @overload def _begin_evaluate_model( - self, - project_name: str, - trained_model_label: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any + self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models._models.EvaluationJobResult]: ... @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", - params_added_on={"2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "content_type"]}, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + method_added_on="2025-05-15-preview", + 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( - self, - project_name: str, - trained_model_label: str, - body: Union[_models.EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any + self, trained_model_label: str, body: Union[_models.EvaluationDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models._models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. - :param project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param body: The training input parameters. Is one of the following types: EvaluationDetails, @@ -6185,7 +5936,6 @@ def _begin_evaluate_model( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._evaluate_model_initial( - project_name=project_name, trained_model_label=trained_model_label, body=body, content_type=content_type, @@ -6225,17 +5975,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models._models.EvaluationJobResult].from_continuation_token( # pylint:disable=protected-access + 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._models.EvaluationJobResult]( # pylint:disable=protected-access + return LROPoller[_models._models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _load_snapshot_initial(self, project_name: str, trained_model_label: str, **kwargs: Any) -> Iterator[bytes]: + def _load_snapshot_initial(self, trained_model_label: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6250,8 +6000,8 @@ def _load_snapshot_initial(self, project_name: str, trained_model_label: str, ** cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_trained_model_load_snapshot_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6287,11 +6037,9 @@ def _load_snapshot_initial(self, project_name: str, trained_model_label: str, ** return deserialized # type: ignore @distributed_trace - def _begin_load_snapshot(self, project_name: str, 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 project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: An instance of LROPoller that returns None @@ -6307,7 +6055,6 @@ def _begin_load_snapshot(self, project_name: str, trained_model_label: str, **kw cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._load_snapshot_initial( - project_name=project_name, trained_model_label=trained_model_label, cls=lambda x, y, z: x, headers=_headers, @@ -6344,19 +6091,17 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2023-04-15-preview", + method_added_on="2025-05-15-preview", params_added_on={ - "2023-04-15-preview": ["api_version", "project_name", "trained_model_label", "job_id", "accept"] + "2025-05-15-preview": ["api_version", "project_name", "trained_model_label", "job_id", "accept"] }, - api_versions_list=["2023-04-15-preview", "2024-11-15-preview", "2025-05-15-preview"], + api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def _get_evaluation_status( - self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + self, trained_model_label: str, job_id: str, **kwargs: Any ) -> _models._models.EvaluationState: """Gets the status for an evaluation job. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param job_id: The job ID. Required. @@ -6379,9 +6124,9 @@ def _get_evaluation_status( cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( - project_name=project_name, trained_model_label=trained_model_label, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6422,7 +6167,6 @@ def _get_evaluation_status( @distributed_trace def get_model_evaluation_results( self, - project_name: str, trained_model_label: str, *, string_index_type: Union[str, _models.StringIndexType], @@ -6433,8 +6177,6 @@ def get_model_evaluation_results( """Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :keyword string_index_type: Specifies the method used to interpret string offsets. For @@ -6456,7 +6198,7 @@ def get_model_evaluation_results( _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models.UtteranceEvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.UtteranceEvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6470,8 +6212,8 @@ def prepare_request(next_link=None): if not next_link: _request = build_trained_model_get_model_evaluation_results_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, string_index_type=string_index_type, top=top, skip=skip, @@ -6511,7 +6253,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.UtteranceEvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.UtteranceEvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6534,14 +6276,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_model_evaluation_summary( - self, project_name: str, trained_model_label: str, **kwargs: Any - ) -> _models.EvalSummary: + def get_model_evaluation_summary(self, trained_model_label: str, **kwargs: Any) -> _models.EvalSummary: """Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. - :param project_name: The name of the project to use. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :return: EvalSummary. The EvalSummary is compatible with MutableMapping @@ -6562,8 +6300,8 @@ def get_model_evaluation_summary( cls: ClsType[_models.EvalSummary] = kwargs.pop("cls", None) _request = build_trained_model_get_model_evaluation_summary_request( - project_name=project_name, trained_model_label=trained_model_label, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6601,12 +6339,10 @@ def get_model_evaluation_summary( @distributed_trace def _get_load_snapshot_status( - self, project_name: str, trained_model_label: str, job_id: str, **kwargs: Any + self, trained_model_label: str, job_id: str, **kwargs: Any ) -> _models._models.LoadSnapshotState: """Gets the status for loading a snapshot. - :param project_name: The new project name. Required. - :type project_name: str :param trained_model_label: The trained model label. Required. :type trained_model_label: str :param job_id: The job ID. Required. @@ -6629,9 +6365,9 @@ def _get_load_snapshot_status( cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( - project_name=project_name, trained_model_label=trained_model_label, job_id=job_id, + project_name=self._config.project_name, api_version=self._config.api_version, headers=_headers, params=_params, 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 43cd6bc6524b..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,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,10 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from ._project_op_patch import ProjectOperations -from ._trained_model_op_patch import TrainedModelOperations -from ._deployment_op_patch import DeploymentOperations -from ._exported_model_op_patch import ExportedModelOperations + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -21,6 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - - -__all__ = ["ProjectOperations", "DeploymentOperations", "ExportedModelOperations", "TrainedModelOperations"] 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 30621495f13d..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py +++ /dev/null @@ -1,918 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, cast, overload - -from azure.core.paging import ItemPaged -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 ( - AssignedDeploymentResource, - AssignDeploymentResourcesDetails, - CopyProjectDetails, - CopyProjectState, - DeploymentResourcesState, - ExportProjectState, - ExportedProject, - ExportedProjectFormat, - ExportedTrainedModel, - ProjectDeletionState, - ProjectDeployment, - ProjectDetails, - ProjectKind, - ProjectTrainedModel, - StringIndexType, - SwapDeploymentsDetails, - SwapDeploymentsState, - TrainingJobDetails, - TrainingJobResult, - TrainingState, - UnassignDeploymentResourcesDetails, -) -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.""" - - def __init__(self, *args, project_name: str, **kwargs: Any): - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - def begin_import( - self, - body: ExportedProject, - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @overload - def begin_import( - self, - body: JSON, - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @overload - def begin_import( - self, - body: IO[bytes], - *, - exported_project_format: Optional[Union[str, 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: - - """ - - @distributed_trace - def begin_import( - self, - body: Union[ExportedProject, JSON, IO[bytes]], - *, - exported_project_format: Optional[Union[str, 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 or JSON or IO[bytes] - :keyword exported_project_format: The format of the exported project file to use. Known values are: "Conversation" and "Luis". - :paramtype exported_project_format: str or ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - - """ - return super()._begin_import_method( - project_name=self._project_name, - body=body, - exported_project_format=exported_project_format, - content_type=content_type, - **kwargs, - ) - - @overload - def begin_assign_deployment_resources( - self, body: AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails - :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: - """ - - @overload - def begin_assign_deployment_resources( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources 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: - """ - - @overload - def begin_assign_deployment_resources( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. This API is - available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, check here: - `https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - `_. - - :param body: The new project resources 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: - """ - - @distributed_trace - def begin_assign_deployment_resources( - self, body: Union[AssignDeploymentResourcesDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Assign new Azure resources to a project to allow deploying new deployments to them. - This API is available only via AAD authentication and not supported via subscription key authentication. - For more details about AAD authentication, see: - https://learn.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory - - :param body: The new project resources info. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_assign_deployment_resources( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - def begin_swap_deployments( - self, body: 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: - """ - - @overload - 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: - """ - - @overload - 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: - """ - - @distributed_trace - def begin_swap_deployments( - self, body: Union[SwapDeploymentsDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_swap_deployments( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - def begin_unassign_deployment_resources( - self, body: UnassignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. Required. - :type body: ~azure.ai.language.conversations.authoring.models.UnassignDeploymentResourcesDetails - :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: - """ - - @overload - def begin_unassign_deployment_resources( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. 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: - """ - - @overload - 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 deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. 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: - """ - - @distributed_trace - def begin_unassign_deployment_resources( - self, body: Union[UnassignDeploymentResourcesDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """Unassign resources from a project. This disallows deploying new deployments to these resources, - and deletes existing deployments assigned to them. - - :param body: The info for the deployment resources to be deleted. Required. - :type body: ~azure.ai.language.conversations.authoring.models.UnassignDeploymentResourcesDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_unassign_deployment_resources( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @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( - project_name=self._project_name, - 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 - # ) - - @overload - def begin_copy_project( - self, body: 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: - """ - - @overload - 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: - """ - - @overload - 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: - """ - - @distributed_trace - def begin_copy_project( - self, body: Union[CopyProjectDetails, JSON, 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: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails or JSON or IO[bytes] - :keyword str content_type: Media type of the request body. Default is "application/json". - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_copy_project( - project_name=self._project_name, body=body, content_type=content_type, **kwargs - ) - - @overload - def begin_train( - self, body: TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[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: - """ - - @overload - def begin_train( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[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: - """ - - @overload - def begin_train( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[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: - """ - - @distributed_trace - def begin_train( # type: ignore[override] - self, body: Union[TrainingJobDetails, JSON, IO[bytes]], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[TrainingJobResult]: - """Triggers a training job for a project. - - :param body: The training input parameters. Required. - :type body: Union[TrainingJobDetails, JSON, IO[bytes]] - :keyword content_type: Body Parameter content-type. Content type parameter for the request 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: - """ - return super()._begin_train(project_name=self._project_name, body=body, content_type=content_type, **kwargs) - - @distributed_trace - def begin_export( - self, - *, - string_index_type: Union[str, StringIndexType], - exported_project_format: Optional[Union[str, ExportedProjectFormat]] = None, - asset_kind: Optional[str] = None, - trained_model_label: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Triggers a job to export a project's data. - - :keyword string_index_type: Specifies the method used to interpret string offsets. See - https://aka.ms/text-analytics-offsets. Known values: "Utf16CodeUnit", "Utf8CodeUnit", - "Utf32CodeUnit". Required. - :paramtype string_index_type: str or ~azure.ai.language.conversations.authoring.models.StringIndexType - :keyword exported_project_format: The export format. Known values: "Conversation", "Luis". - :paramtype exported_project_format: str or ~azure.ai.language.conversations.authoring.models.ExportedProjectFormat - :keyword asset_kind: Kind of asset to export. - :paramtype asset_kind: str - :keyword trained_model_label: Trained model label to export. If None, exports the working copy. - :paramtype trained_model_label: str - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_export( - project_name=self._project_name, - asset_kind=asset_kind, - exported_project_format=exported_project_format, - string_index_type=string_index_type, - trained_model_label=trained_model_label, - **kwargs, - ) - - @overload - def copy_project_authorization( - self, - *, - project_kind: Union[str, ProjectKind], - content_type: str = "application/json", - storage_input_container_name: Optional[str] = None, - allow_overwrite: Optional[bool] = None, - **kwargs: Any - ) -> 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: - """ - - @overload - def copy_project_authorization( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> 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: - """ - - @overload - def copy_project_authorization( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> 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: - """ - - @distributed_trace - def copy_project_authorization( # type: ignore[override] - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - allow_overwrite: Optional[bool] = _Unset, - project_kind: Union[str, Any] = _Unset, - storage_input_container_name: Optional[str] = _Unset, - **kwargs: Any - ) -> 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. - :type body: JSON or IO[bytes] - :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 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._models.CopyProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._copy_project_authorization( - project_name=self._project_name, - body=body, - allow_overwrite=allow_overwrite, - project_kind=project_kind, - storage_input_container_name=storage_input_container_name, - **kwargs, - ) - - @distributed_trace - def _get_assign_deployment_resources_status( # type: ignore[override] - self, job_id: str, **kwargs: Any - ) -> DeploymentResourcesState: - """Gets the status of an existing assign deployment resources job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_assign_deployment_resources_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> CopyProjectState: # type: ignore[override] - """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._models.CopyProjectState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_copy_project_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def _get_export_status(self, job_id: str, **kwargs: Any) -> ExportProjectState: # type: ignore[override] - """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._models.ExportProjectState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_export_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def get_project(self, **kwargs: Any) -> ProjectDetails: # type: ignore[override] - """Gets the details of a project. - - :return: ProjectDetails. The ProjectDetails is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_project(project_name=self._project_name, **kwargs) - - @distributed_trace - def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> ProjectDeletionState: # type: ignore[override] - """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._models.ProjectDeletionState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_project_deletion_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> SwapDeploymentsState: # type: ignore[override] - """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._models.SwapDeploymentsState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_swap_deployments_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def _get_training_status(self, job_id: str, **kwargs: Any) -> TrainingState: # type: ignore[override] - """Gets the status for a training job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: TrainingState. The TrainingState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.TrainingState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_training_status(project_name=self._project_name, job_id=job_id, **kwargs) - - @distributed_trace - def _get_unassign_deployment_resources_status( # type: ignore[override] - self, job_id: str, **kwargs: Any - ) -> DeploymentResourcesState: - """Gets the status of an existing unassign deployment resources job. - - :param job_id: The job ID. Required. - :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_unassign_deployment_resources_status( - project_name=self._project_name, job_id=job_id, **kwargs - ) - - @distributed_trace - def list_deployment_resources( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> ItemPaged[AssignedDeploymentResource]: - """Lists the deployments 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 AssignedDeploymentResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_deployment_resources(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_deployments( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> ItemPaged[ProjectDeployment]: - """Lists the deployments belonging to a 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 ProjectDeployment - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.ProjectDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_deployments(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_exported_models( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> ItemPaged[ExportedTrainedModel]: - """Lists the exported models belonging to a 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 ExportedTrainedModel - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.ExportedTrainedModel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_exported_models(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_trained_models( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> ItemPaged[ProjectTrainedModel]: - """Lists the trained models belonging to a 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 ProjectTrainedModel - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.ProjectTrainedModel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_trained_models(project_name=self._project_name, skip=skip, top=top, **kwargs) - - @distributed_trace - def list_training_jobs( # type: ignore[override] - self, *, skip: Optional[int] = _Unset, top: Optional[int] = _Unset, **kwargs: Any - ) -> ItemPaged[TrainingState]: - """Lists the non-expired training jobs created for a 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 TrainingState - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.TrainingState] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().list_training_jobs(project_name=self._project_name, skip=skip, top=top, **kwargs) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_trained_model_op_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_trained_model_op_patch.py deleted file mode 100644 index 644a12e7f32e..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_trained_model_op_patch.py +++ /dev/null @@ -1,287 +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 IO, Any, Callable, Dict, Optional, TypeVar, Union, overload - -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace - -from ..models import ( - EvalSummary, - EvaluationDetails, - EvaluationJobResult, - EvaluationState, - LoadSnapshotState, - ProjectTrainedModel, - StringIndexType, - UtteranceEvaluationResult, -) -from ._operations import TrainedModelOperations as TrainedModelOperationsGenerated - -JSON = MutableMapping[str, Any] -T = TypeVar("T") -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] - - -class TrainedModelOperations(TrainedModelOperationsGenerated): - - def __init__(self, *args, project_name: str, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self._project_name = project_name - - @overload - def begin_evaluate_model( - self, - trained_model_label: str, - body: EvaluationDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[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: - """ - - @overload - def begin_evaluate_model( - self, trained_model_label: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[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: - """ - - @overload - def begin_evaluate_model( - self, trained_model_label: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[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: - """ - - @distributed_trace - def begin_evaluate_model( - self, - trained_model_label: str, - body: Union[EvaluationDetails, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[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. Is one of the following types: EvaluationDetails, - JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.EvaluationDetails or JSON or - IO[bytes] - :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._models.EvaluationJobResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_evaluate_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - body=body, - **kwargs, - ) - - @distributed_trace - 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. - :type trained_model_label: str - :return: An instance of LROPoller that returns None. - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._begin_load_snapshot( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace - def delete_trained_model(self, trained_model_label: str, **kwargs: Any) -> None: # type: ignore[override] - """Deletes an existing trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().delete_trained_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace - def _get_evaluation_status( # type: ignore[override] - self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> EvaluationState: - """Gets the status for an evaluation job. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :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._models.EvaluationState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_evaluation_status( - project_name=self._project_name, - trained_model_label=trained_model_label, - job_id=job_id, - **kwargs, - ) - - @distributed_trace - def _get_load_snapshot_status( # type: ignore[override] - self, trained_model_label: str, job_id: str, **kwargs: Any - ) -> LoadSnapshotState: - """Gets the status for loading a snapshot. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :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._models.LoadSnapshotState - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super()._get_load_snapshot_status( - project_name=self._project_name, - trained_model_label=trained_model_label, - job_id=job_id, - **kwargs, - ) - - @distributed_trace - def get_model_evaluation_results( # type: ignore[override] - self, - trained_model_label: str, - *, - skip: Optional[int] = None, - string_index_type: Union[str, StringIndexType], - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged[UtteranceEvaluationResult]: - """Gets the detailed results of the evaluation for a trained model. This includes the raw - inference results for the data included in the evaluation process. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :keyword string_index_type: Specifies the method used to interpret string offsets. For - additional information see `https://aka.ms/text-analytics-offsets - `_. Known values are: "Utf16CodeUnit", "Utf8CodeUnit", - and "Utf32CodeUnit". Required. - :paramtype string_index_type: str or - ~azure.ai.language.conversations.authoring.models.StringIndexType - :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 UtteranceEvaluationResult - :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.UtteranceEvaluationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_model_evaluation_results( - project_name=self._project_name, - trained_model_label=trained_model_label, - skip=skip, - string_index_type=string_index_type, - top=top, - **kwargs, - ) - - @distributed_trace - def get_model_evaluation_summary( # type: ignore[override] - self, trained_model_label: str, **kwargs: Any - ) -> EvalSummary: - """Gets the evaluation summary of a trained model. The summary includes high level performance - measurements of the model e.g., F1, Precision, Recall, etc. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: EvalSummary. The EvalSummary is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.EvalSummary - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_model_evaluation_summary( - project_name=self._project_name, - trained_model_label=trained_model_label, - **kwargs, - ) - - @distributed_trace - def get_trained_model( # type: ignore[override] - self, trained_model_label: str, **kwargs: Any - ) -> ProjectTrainedModel: - """Gets the details of a trained model. - - :param trained_model_label: The trained model label. Required. - :type trained_model_label: str - :return: ProjectTrainedModel. The ProjectTrainedModel is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.ProjectTrainedModel - :raises ~azure.core.exceptions.HttpResponseError: - """ - return super().get_trained_model( - project_name=self._project_name, - trained_model_label=trained_model_label, - **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/pyproject.toml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml index 2a5b1729759e..71f28fbbb24c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml @@ -1,18 +1,14 @@ -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- - [build-system] -requires = ["setuptools>=77.0.3", "wheel"] +requires = [ + "setuptools>=77.0.3", + "wheel", +] build-backend = "setuptools.build_meta" [project] name = "azure-ai-language-conversations-authoring" authors = [ - { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] description = "Microsoft Corporation Azure Ai Language Conversations Authoring Client Library for Python" license = "MIT" @@ -28,8 +24,10 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] requires-python = ">=3.9" -keywords = ["azure", "azure sdk"] - +keywords = [ + "azure", + "azure sdk", +] dependencies = [ "isodate>=0.6.1", "azure-core>=1.35.0", @@ -37,20 +35,29 @@ dependencies = [ "azure-ai-language-conversations>=2.0.0b1", ] dynamic = [ -"version", "readme" + "version", + "readme", ] [project.urls] repository = "https://github.com/Azure/azure-sdk-for-python" -[tool.setuptools.dynamic] -version = {attr = "azure.ai.language.conversations.authoring._version.VERSION"} -readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} +[tool.setuptools.dynamic.version] +attr = "azure.ai.language.conversations.authoring._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" [tool.setuptools.packages.find] exclude = [ "tests*", + "generated_tests*", "samples*", + "generated_samples*", "doc*", "azure", "azure.ai", @@ -59,4 +66,9 @@ exclude = [ ] [tool.setuptools.package-data] -pytyped = ["py.typed"] +pytyped = [ + "py.typed", +] + +[packaging] +auto_update = false diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py index 7e23c8126482..c1b89349bd1e 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py @@ -75,8 +75,10 @@ async def sample_assign_deployment_resources_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_assign_deployment_resources_async] + async def main(): await sample_assign_deployment_resources_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py index 2a931d073988..d481a65812d9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py @@ -63,8 +63,10 @@ async def sample_cancel_training_job_async(): print(f"Evaluation %: {result.evaluation_status.percent_complete}") print(f"Estimated End: {result.estimated_end_on}") + # [END conversation_authoring_cancel_training_job_async] + async def main(): await sample_cancel_training_job_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py index 29a86d2b97b3..ef752d3844a2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py @@ -36,6 +36,7 @@ ProjectKind, ) + async def sample_create_project_async(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] @@ -63,8 +64,10 @@ async def sample_create_project_async(): print(f"Multilingual: {result.multilingual}") print(f"Description: {result.description}") + # [END conversation_authoring_create_project_async] + async def main(): await sample_create_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py index 9de6c5a4d6fa..1b86815373b6 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py @@ -46,9 +46,7 @@ async def sample_delete_deployment_async(): project_client = client.get_project_client(project_name) # start delete (async long-running operation) - poller = await project_client.deployment.begin_delete_deployment( - deployment_name=deployment_name - ) + poller = await project_client.deployment.begin_delete_deployment(deployment_name=deployment_name) try: await poller.result() @@ -59,8 +57,10 @@ async def sample_delete_deployment_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_delete_deployment_async] + async def main(): await sample_delete_deployment_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_project_async.py index d6f4397ed093..8b2c4d4218b8 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_project_async.py @@ -53,8 +53,10 @@ async def sample_delete_project_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_delete_project_async] + async def main(): await sample_delete_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_trained_model_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_trained_model_async.py index b4c37a888db9..7efe692f5ad0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_trained_model_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_trained_model_async.py @@ -60,8 +60,10 @@ def capture_response(pipeline_response): status = captured.get("status_code") print(f"Delete Trained Model Response Status: {status}") + # [END conversation_authoring_delete_trained_model_async] + async def main(): await sample_delete_trained_model_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_deploy_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_deploy_project_async.py index 05ec9f3fc687..0b14aabae08b 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_deploy_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_deploy_project_async.py @@ -67,8 +67,10 @@ async def sample_deploy_project_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_deploy_project_async] + async def main(): await sample_deploy_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_export_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_export_project_async.py index e9d2acaeb002..1276a3791417 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_export_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_export_project_async.py @@ -59,8 +59,10 @@ async def sample_export_project_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_export_project_async] + async def main(): await sample_export_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py index 7bbd8c93a68c..add2ef1cfdae 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py @@ -66,8 +66,10 @@ async def sample_get_deployment_async(): print(f"AOAI Resource ID: {aoai.resource_id}") print(f"AOAI Deployment Name: {aoai.deployment_name}") + # [END conversation_authoring_get_deployment_async] + async def main(): await sample_get_deployment_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_results_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_results_async.py index 1692d90e4a35..5112ada9d5ac 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_results_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_results_async.py @@ -78,8 +78,10 @@ async def sample_get_model_evaluation_results_async(): print(f"Total Results: {seen}") + # [END conversation_authoring_get_model_evaluation_results_async] + async def main(): await sample_get_model_evaluation_results_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_summary_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_summary_async.py index f3173208d9d6..1c6cd354bda6 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_summary_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_model_evaluation_summary_async.py @@ -68,7 +68,9 @@ async def sample_get_model_evaluation_summary_async(): # Per-entity details ent_map = entities_summary.entities or {} for entity_name, entity_summary in ent_map.items(): - print(f"Entity '{entity_name}': F1 = {entity_summary.f1}, Precision = {entity_summary.precision}, Recall = {entity_summary.recall}") + print( + f"Entity '{entity_name}': F1 = {entity_summary.f1}, Precision = {entity_summary.precision}, Recall = {entity_summary.recall}" + ) print( f" True Positives: {entity_summary.true_positive_count}, " f"True Negatives: {entity_summary.true_negative_count}" @@ -95,7 +97,9 @@ async def sample_get_model_evaluation_summary_async(): # Per-intent details intent_map = intents_summary.intents or {} for intent_name, intent_summary in intent_map.items(): - print(f"Intent '{intent_name}': F1 = {intent_summary.f1}, Precision = {intent_summary.precision}, Recall = {intent_summary.recall}") + print( + f"Intent '{intent_name}': F1 = {intent_summary.f1}, Precision = {intent_summary.precision}, Recall = {intent_summary.recall}" + ) print( f" True Positives: {intent_summary.true_positive_count}, " f"True Negatives: {intent_summary.true_negative_count}" @@ -105,8 +109,10 @@ async def sample_get_model_evaluation_summary_async(): f"False Negatives: {intent_summary.false_negative_count}" ) + # [END conversation_authoring_get_model_evaluation_summary_async] + async def main(): await sample_get_model_evaluation_summary_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py index 60b078348479..5d64097e01c9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py @@ -55,8 +55,10 @@ async def sample_get_project_async(): print(f"Description: {details.description}") print(f"Language: {details.language}") + # [END conversation_authoring_get_project_async] + async def main(): await sample_get_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_import_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_import_project_async.py index 10efbcb05ebf..6a7140876791 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_import_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_import_project_async.py @@ -130,8 +130,10 @@ async def sample_import_project_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_import_project_async] + async def main(): await sample_import_project_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_load_snapshot_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_load_snapshot_async.py index b467503f7d94..ad06737aef7d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_load_snapshot_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_load_snapshot_async.py @@ -57,8 +57,10 @@ async def sample_load_snapshot_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_load_snapshot_async] + async def main(): await sample_load_snapshot_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_swap_deployments_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_swap_deployments_async.py index add3a7b772ec..b46fba1e3824 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_swap_deployments_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_swap_deployments_async.py @@ -66,8 +66,10 @@ async def sample_swap_deployments_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_swap_deployments_async] + async def main(): await sample_swap_deployments_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_train_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_train_async.py index dc33be92f4fa..65a8c734b840 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_train_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_train_async.py @@ -78,8 +78,10 @@ async def sample_train_async(): print(f"Evaluation Status: {result.evaluation_status}") print(f"Estimated End: {result.estimated_end_on}") + # [END conversation_authoring_train_async] + async def main(): await sample_train_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py index ef7ab0556bd5..abc1a95127e7 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -37,6 +37,7 @@ UnassignDeploymentResourcesDetails, ) + async def sample_unassign_deployment_resources_async(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] @@ -63,8 +64,10 @@ async def sample_unassign_deployment_resources_async(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_unassign_deployment_resources_async] + async def main(): await sample_unassign_deployment_resources_async() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py index 848467a78c8e..7c2d936157c0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py @@ -75,6 +75,7 @@ def sample_assign_deployment_resources(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_assign_deployment_resources] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_cancel_training_job.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_cancel_training_job.py index 6633163e8bcd..064c83485c0f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_cancel_training_job.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_cancel_training_job.py @@ -45,8 +45,8 @@ def sample_cancel_training_job(): project_client = client.get_project_client(project_name) poller = project_client.project.begin_cancel_training_job( - job_id=job_id, - ) + job_id=job_id, + ) result = poller.result() # TrainingJobResult print(f"Model Label: {result.model_label}") @@ -63,6 +63,7 @@ def sample_cancel_training_job(): print(f"Evaluation %: {result.evaluation_status.percent_complete}") print(f"Estimated End: {result.estimated_end_on}") + # [END conversation_authoring_cancel_training_job] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_create_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_create_project.py index 33cfd1ec3393..f76148301887 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_create_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_create_project.py @@ -65,6 +65,7 @@ def sample_create_project(): print(f"Multilingual: {result.multilingual}") print(f"Description: {result.description}") + # [END conversation_authoring_create_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment.py index 683483b44b9e..d8b7697eceef 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment.py @@ -46,9 +46,7 @@ def sample_delete_deployment(): project_client = client.get_project_client(project_name) # start delete (long-running operation) - poller = project_client.deployment.begin_delete_deployment( - deployment_name=deployment_name - ) + poller = project_client.deployment.begin_delete_deployment(deployment_name=deployment_name) try: poller.result() @@ -59,6 +57,7 @@ def sample_delete_deployment(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_delete_deployment] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_project.py index 2a4ce13768b1..814e08ffd34f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_project.py @@ -54,6 +54,7 @@ def sample_delete_project(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_delete_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_trained_model.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_trained_model.py index cac4e84f39a0..390542a3517c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_trained_model.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_trained_model.py @@ -60,6 +60,7 @@ def capture_response(pipeline_response): status = captured.get("status_code") print(f"Delete Trained Model Response Status: {status}") + # [END conversation_authoring_delete_trained_model] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_deploy_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_deploy_project.py index 4d44244641d4..a08f132454d6 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_deploy_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_deploy_project.py @@ -66,6 +66,8 @@ def sample_deploy_project(): except HttpResponseError as e: print(f"Operation failed: {e.message}") print(e.error) + + # [END conversation_authoring_deploy_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_export_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_export_project.py index 571b80927337..0f1d5ea28d4a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_export_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_export_project.py @@ -61,6 +61,7 @@ def sample_export_project(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_export_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment.py index d1199b969930..bc0571f90919 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment.py @@ -66,6 +66,7 @@ def sample_get_deployment(): print(f"AOAI Resource ID: {aoai.resource_id}") print(f"AOAI Deployment Name: {aoai.deployment_name}") + # [END conversation_authoring_get_deployment] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_results.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_results.py index 50037890a143..5c2cca926638 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_results.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_results.py @@ -76,6 +76,7 @@ def sample_get_model_evaluation_results(): print(f"Total Results: {seen}") + # [END conversation_authoring_get_model_evaluation_results] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_summary.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_summary.py index 3e99be7dade6..9fbf68dc9e92 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_summary.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_model_evaluation_summary.py @@ -51,7 +51,7 @@ def sample_get_model_evaluation_summary(): print("=== Model Evaluation Summary ===") - # ----- Entities evaluation (micro/macro) ----- + # ----- Entities evaluation (micro/macro) ----- entities_summary = eval_summary.entities_evaluation if entities_summary is not None: print( @@ -68,7 +68,9 @@ def sample_get_model_evaluation_summary(): # Per-entity details ent_map = entities_summary.entities or {} for entity_name, entity_summary in ent_map.items(): - print(f"Entity '{entity_name}': F1 = {entity_summary.f1}, Precision = {entity_summary.precision}, Recall = {entity_summary.recall}") + print( + f"Entity '{entity_name}': F1 = {entity_summary.f1}, Precision = {entity_summary.precision}, Recall = {entity_summary.recall}" + ) print( f" True Positives: {entity_summary.true_positive_count}, " f"True Negatives: {entity_summary.true_negative_count}" @@ -95,7 +97,9 @@ def sample_get_model_evaluation_summary(): # Per-intent details intent_map = intents_summary.intents or {} for intent_name, intent_summary in intent_map.items(): - print(f"Intent '{intent_name}': F1 = {intent_summary.f1}, Precision = {intent_summary.precision}, Recall = {intent_summary.recall}") + print( + f"Intent '{intent_name}': F1 = {intent_summary.f1}, Precision = {intent_summary.precision}, Recall = {intent_summary.recall}" + ) print( f" True Positives: {intent_summary.true_positive_count}, " f"True Negatives: {intent_summary.true_negative_count}" @@ -105,6 +109,7 @@ def sample_get_model_evaluation_summary(): f"False Negatives: {intent_summary.false_negative_count}" ) + # [END conversation_authoring_get_model_evaluation_summary] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_project.py index 48b40125c24f..ae6e2ef03b77 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_project.py @@ -56,6 +56,7 @@ def sample_get_project(): print(f"Description: {details.description}") print(f"Language: {details.language}") + # [END conversation_authoring_get_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_import_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_import_project.py index 62e834478b64..d71be8f0fbaf 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_import_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_import_project.py @@ -129,6 +129,7 @@ def sample_import_project(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_import_project] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_load_snapshot.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_load_snapshot.py index 1536e9affea9..7a51e4904909 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_load_snapshot.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_load_snapshot.py @@ -57,6 +57,7 @@ def sample_load_snapshot(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_load_snapshot] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_swap_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_swap_deployments.py index a5348595fdd0..45ddde5719d4 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_swap_deployments.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_swap_deployments.py @@ -66,6 +66,7 @@ def sample_swap_deployments(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_swap_deployments] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_train.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_train.py index 455df49debd8..bad9fc8b9421 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_train.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_train.py @@ -77,6 +77,7 @@ def sample_train(): print(f"Evaluation Status: {result.evaluation_status}") print(f"Estimated End: {result.estimated_end_on}") + # [END conversation_authoring_train] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py index 3ee5a5bd5f85..59c39cd0b552 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py @@ -66,6 +66,7 @@ def sample_unassign_deployment_resources(): print(f"Operation failed: {e.message}") print(e.error) + # [END conversation_authoring_unassign_deployment_resources] diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/sdk_packaging.toml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/sdk_packaging.toml deleted file mode 100644 index e7687fdae93b..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/sdk_packaging.toml +++ /dev/null @@ -1,2 +0,0 @@ -[packaging] -auto_update = false \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py index dadbe352c237..3e0954e58e75 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py @@ -27,7 +27,7 @@ def test_cancel_training_job(self, authoring_endpoint, authoring_key): client = self.create_client(authoring_endpoint, authoring_key) project_client = client.get_project_client("Test-data-labels") - job_id="e097b8e7-5cef-491a-aba6-24a82580973e_638919360000000000" + job_id = "e097b8e7-5cef-491a-aba6-24a82580973e_638919360000000000" poller = project_client.project.begin_cancel_training_job( job_id=job_id, @@ -35,7 +35,9 @@ def test_cancel_training_job(self, authoring_endpoint, authoring_key): result = poller.result() # TrainingJobResult - assert result.training_status.status == "cancelled", f"Cancellation failed with status: {result.training_status.status}" + assert ( + result.training_status.status == "cancelled" + ), f"Cancellation failed with status: {result.training_status.status}" print(f"Model Label: {result.model_label}") print(f"Training Config Version: {result.training_config_version}") print(f"Training Mode: {result.training_mode}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py index 5a4287587924..419fa1a1463e 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py @@ -38,7 +38,9 @@ async def test_cancel_training_job_async(self, authoring_endpoint, authoring_key result = await poller.result() # TrainingJobResult - assert result.training_status.status == "cancelled", f"Cancellation failed with status: {result.training_status.status}" + assert ( + result.training_status.status == "cancelled" + ), f"Cancellation failed with status: {result.training_status.status}" print(f"Model Label: {result.model_label}") print(f"Training Config Version: {result.training_config_version}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment.py index 700ad75a0c85..fc38f4a9a8b6 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment.py @@ -33,13 +33,13 @@ def test_delete_deployment(self, authoring_endpoint, authoring_key): # Act: begin delete and wait for completion poller = project_client.deployment.begin_delete_deployment(deployment_name=deployment_name) - + try: poller.result() except HttpResponseError as e: print(f"Operation failed: {e.message}") print(e.error) raise - + # If we get here, the delete succeeded - print(f"Delete completed. done={poller.done()} status={poller.status()}") \ No newline at end of file + print(f"Delete completed. done={poller.done()} status={poller.status()}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_async.py index 3848db3c01b2..d345f504bace 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_async.py @@ -35,9 +35,7 @@ async def test_delete_deployment_async(self, authoring_endpoint, authoring_key): project_client = client.get_project_client(project_name) # Begin delete; Async poller now returns None on success - poller = await project_client.deployment.begin_delete_deployment( - deployment_name=deployment_name - ) + poller = await project_client.deployment.begin_delete_deployment(deployment_name=deployment_name) try: await poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_project.py index 65248922c8f5..3ae39d8aee9b 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_project.py @@ -38,6 +38,6 @@ def test_delete_project(self, authoring_endpoint, authoring_key): print(f"Operation failed: {e.message}") print(e.error) raise - + # If we get here, the delete succeeded print(f"Delete completed. done={poller.done()} status={poller.status()}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_export_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_export_project.py index 487bcc2140ed..3b9abfa48634 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_export_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_export_project.py @@ -22,6 +22,7 @@ class TestConversations(AzureRecordedTestCase): def create_client(self, endpoint, key): return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + class TestConversationsExportCase(TestConversations): @ConversationsPreparer() @recorded_by_proxy diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_get_model_evaluation_summary.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_get_model_evaluation_summary.py index 7a8caa9b606c..cc628e43be1c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_get_model_evaluation_summary.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_get_model_evaluation_summary.py @@ -35,7 +35,7 @@ def test_get_model_evaluation_summary(self, authoring_endpoint, authoring_key): # Basic assertion the call returned something shaped like a summary assert eval_summary is not None - # ----- Entities evaluation (micro/macro) ----- + # ----- Entities evaluation (micro/macro) ----- entities_summary = eval_summary.entities_evaluation if entities_summary is not None: print( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_swap_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_swap_deployments.py index 981f44161893..ad2a9253a794 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_swap_deployments.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_swap_deployments.py @@ -6,7 +6,7 @@ from azure.ai.language.conversations.authoring import ConversationAuthoringClient from azure.ai.language.conversations.authoring.models import ( SwapDeploymentsDetails, -) +) ConversationsPreparer = functools.partial( EnvironmentVariableLoader, @@ -47,4 +47,4 @@ def test_swap_deployments(self, authoring_endpoint, authoring_key): raise # Success -> poller completed - print(f"Swap deployments completed. done={poller.done()} status={poller.status()}") \ No newline at end of file + print(f"Swap deployments completed. done={poller.done()} status={poller.status()}") 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 12524fd66290..2571974fb43c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/cognitiveservices/Language.AnalyzeConversations-authoring -commit: c349a7a66f40b75502a4706cd15be50a26ee49ef +directory: specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring +commit: d8f039ebd965e40471a082c547b103dd5dc9a33b repo: Azure/azure-rest-api-specs additionalDirectories: From 64b6aaacf2637355621bd35c13873ff16434887c Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 10:50:30 -0800 Subject: [PATCH 02/17] updated version to 1.0.0b2 --- .../azure/ai/language/conversations/authoring/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 be71c81bd282..bbcd28b4aa67 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.0b1" +VERSION = "1.0.0b2" From 9cb117429df3a3452d31c15583d30131405a40a1 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 10:51:55 -0800 Subject: [PATCH 03/17] removed generated samples --- .../successful_cancel_training_job.py | 34 ------- .../successful_create_project.py | 40 -------- .../successful_delete_model.py | 33 ------- .../successful_get_deployment.py | 34 ------- .../successful_get_exported_model.py | 34 ------- .../successful_get_model.py | 34 ------- .../successful_get_model_evaluation.py | 36 ------- ...successful_get_model_evaluation_summary.py | 35 ------- .../successful_get_project.py | 33 ------- .../successful_get_supported_languages.py | 34 ------- ...cessful_get_supported_prebuilt_entities.py | 33 ------- ..._get_supported_training_config_versions.py | 35 ------- ...sful_list_assigned_resource_deployments.py | 33 ------- .../successful_list_deployments.py | 33 ------- .../successful_list_exported_models.py | 33 ------- .../successful_list_models.py | 33 ------- .../successful_list_project_resources.py | 33 ------- .../successful_list_projects.py | 32 ------- .../successful_list_training_jobs.py | 33 ------- .../generated_tests/conftest.py | 70 -------------- .../test_conversation_authoring.py | 93 ------------------ .../test_conversation_authoring_async.py | 94 ------------------- ...authoring_project_deployment_operations.py | 24 ----- ...ing_project_deployment_operations_async.py | 25 ----- ...oring_project_exported_model_operations.py | 24 ----- ...project_exported_model_operations_async.py | 25 ----- ...on_authoring_project_project_operations.py | 69 -------------- ...horing_project_project_operations_async.py | 72 -------------- ...horing_project_trained_model_operations.py | 58 ------------ ..._project_trained_model_operations_async.py | 59 ------------ .../generated_tests/testpreparer.py | 46 --------- .../generated_tests/testpreparer_async.py | 34 ------- 32 files changed, 1338 deletions(-) delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py delete mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py 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 deleted file mode 100644 index 64b796531561..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_cancel_training_job.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 deleted file mode 100644 index 434c4ce3b770..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_create_project.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 deleted file mode 100644 index 47fe1222936d..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_delete_model.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 393173b40f95..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_deployment.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 deleted file mode 100644 index e6531a51798b..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_exported_model.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 deleted file mode 100644 index 4e23af22bf50..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 deleted file mode 100644 index 74e1c9063e96..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 deleted file mode 100644 index cc084290e391..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_model_evaluation_summary.py +++ /dev/null @@ -1,35 +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. -# 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 deleted file mode 100644 index 933c778cafdb..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_project.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 5bf717f0b238..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_languages.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 deleted file mode 100644 index 15d1e93ec000..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_prebuilt_entities.py +++ /dev/null @@ -1,33 +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. -# 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 deleted file mode 100644 index 1f6380d34231..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_get_supported_training_config_versions.py +++ /dev/null @@ -1,35 +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. -# 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 deleted file mode 100644 index ec7f0cc0a3aa..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_assigned_resource_deployments.py +++ /dev/null @@ -1,33 +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. -# 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 deleted file mode 100644 index 9e92bb86abf9..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_deployments.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 4bee465500da..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_exported_models.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index bfc6a3c51207..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_models.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 8c47b3751596..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_project_resources.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 90e73d9e0edc..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_projects.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 deleted file mode 100644 index d7f22d96e4cc..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_samples/analyzeconversationsauthoring/successful_list_training_jobs.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 8253891081c6..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/conftest.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 deleted file mode 100644 index d15fa71b9b76..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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 deleted file mode 100644 index d3a2ba2fe254..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_async.py +++ /dev/null @@ -1,94 +0,0 @@ -# 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 deleted file mode 100644 index ae9a2624f56c..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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 deleted file mode 100644 index 0a9beabdd667..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_deployment_operations_async.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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 deleted file mode 100644 index 9c78511492a8..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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 deleted file mode 100644 index 235c6d63fccc..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_exported_model_operations_async.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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 deleted file mode 100644 index 53ad7487f073..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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 deleted file mode 100644 index 044b716282e4..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_project_operations_async.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 deleted file mode 100644 index 454412910ebc..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 deleted file mode 100644 index 8cde0e938802..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/test_conversation_authoring_project_trained_model_operations_async.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 deleted file mode 100644 index 7b37dc00dccd..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 deleted file mode 100644 index 35cae060b9ed..000000000000 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/generated_tests/testpreparer_async.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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, - ) From 34c55c9331563b35c227aa9745d16ea22e7cafc0 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 13:47:19 -0800 Subject: [PATCH 04/17] added patch for clients --- .../conversations/authoring/_patch.py | 88 ++++++++++++++++++- .../conversations/authoring/aio/_patch.py | 88 ++++++++++++++++++- 2 files changed, 170 insertions(+), 6 deletions(-) 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 87676c65a8f0..7fb768b22737 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,18 +4,100 @@ # 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) -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + +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, + ) 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/_patch.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/_patch.py index 87676c65a8f0..7b119480b3bb 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,18 +4,100 @@ # 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) -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + +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, + ) 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"] From cfe1af3e87c09b70213af405e208ddd3b30a1793 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 14:43:13 -0800 Subject: [PATCH 05/17] remove internal from generated features --- .../_metadata.json | 6 +- .../apiview-properties.json | 116 ++- .../conversations/authoring/_client.py | 2 + .../conversations/authoring/_patch.py | 9 +- .../conversations/authoring/aio/_client.py | 2 + .../conversations/authoring/aio/_patch.py | 9 +- .../authoring/aio/operations/_operations.py | 918 +++++++++++++----- .../authoring/models/__init__.py | 104 ++ .../conversations/authoring/models/_models.py | 159 ++- .../authoring/operations/_operations.py | 918 +++++++++++++----- .../pyproject.toml | 39 +- .../tsp-location.yaml | 2 +- 12 files changed, 1652 insertions(+), 632 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json index 6b454632cfc2..509044270b48 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/_metadata.json @@ -1,7 +1,3 @@ { - "apiVersion": "2025-11-15-preview", - "commit": "d8f039ebd965e40471a082c547b103dd5dc9a33b", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/cognitiveservices/data-plane/LanguageAnalyzeConversationsAuthoring", - "emitterVersion": "0.53.1" + "apiVersion": "2025-11-15-preview" } \ 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 d5e8477103ba..abf7b93b13cf 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json @@ -1,27 +1,74 @@ { "CrossLanguagePackageId": "Language.Conversations.Authoring", "CrossLanguageDefinitionId": { + "azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceAssignments", "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.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.DeleteDeploymentDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectAzureResourceIds", + "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.DeploymentResourcesState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourcesJobState", + "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.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", @@ -30,8 +77,13 @@ "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", @@ -47,8 +99,24 @@ "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", @@ -59,17 +127,63 @@ "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_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignDeploymentResources", + "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_assign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignDeploymentResources", + "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_unassign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignDeploymentResources", + "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_unassign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignDeploymentResources", + "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_assign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignDeploymentResourcesStatus", + "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_assign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignDeploymentResourcesStatus", + "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_unassign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignDeploymentResourcesStatus", + "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_unassign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignDeploymentResourcesStatus", + "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.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" } } \ 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 047b4a6db134..01d76d5075e7 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,6 +43,8 @@ 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 7fb768b22737..eec33eaeda1c 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 @@ -10,12 +10,7 @@ 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 -) +from .operations import DeploymentOperations, ExportedModelOperations, ProjectOperations, TrainedModelOperations if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -70,7 +65,7 @@ def __init__( ) -> None: """ Create a ConversationAuthoringClient. - + :param str endpoint: Supported Cognitive Services endpoint, e.g. ``https://.api.cognitiveservices.azure.com``. :param credential: Key or token credential. 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 2857b302e5db..650dad14a28b 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,6 +43,8 @@ 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 7b119480b3bb..6475d80052f3 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 @@ -10,12 +10,7 @@ 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 -) +from .operations import DeploymentOperations, ExportedModelOperations, ProjectOperations, TrainedModelOperations if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -70,7 +65,7 @@ def __init__( ) -> None: """ Create a ConversationAuthoringClient. - + :param str endpoint: Supported Cognitive Services endpoint, e.g. ``https://.api.cognitiveservices.azure.com``. :param credential: Key or token credential. 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 768de454d6e2..5069c6293844 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 @@ -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,9 +902,7 @@ 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._models.ExportProjectState: + async def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _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. @@ -912,7 +910,7 @@ async def _get_export_status( :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._models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -926,7 +924,7 @@ async def _get_export_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_export_status_request( project_name=project_name, @@ -959,9 +957,7 @@ async def _get_export_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -969,9 +965,7 @@ async def _get_export_status( return deserialized # type: ignore @distributed_trace_async - async def _get_import_status( - self, project_name: str, job_id: str, **kwargs: Any - ) -> _models._models.ImportProjectState: + async def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ImportProjectState: """Gets the status for an import. :param project_name: The new project name. Required. @@ -979,7 +973,7 @@ async def _get_import_status( :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._models.ImportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.ImportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -993,7 +987,7 @@ async def _get_import_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ImportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ImportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_import_status_request( project_name=project_name, @@ -1026,9 +1020,7 @@ async def _get_import_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ImportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ImportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1117,7 +1109,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._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1180,26 +1172,67 @@ 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._models.CreateDeploymentDetails, + body: _models.CreateDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace_async - async def _begin_deploy_project( - self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_deploy_project( + self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Creates a new deployment or replaces an existing one. @@ -1207,8 +1240,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._models.CreateDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -1312,7 +1345,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. @@ -1367,7 +1400,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._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1430,22 +1463,69 @@ 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._models.DeleteDeploymentDetails, + body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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.DeleteDeploymentDetails + :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: + """ + @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]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -1453,8 +1533,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._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_delete_deployment_from_resources( + self, deployment_name: str, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -1463,8 +1543,8 @@ async def _begin_delete_deployment_from_resources( :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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -1522,9 +1602,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._models.DeploymentDeleteFromResourcesState: + ) -> _models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. :param deployment_name: Represents deployment name. Required. @@ -1533,8 +1613,7 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- :type job_id: str :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is compatible with MutableMapping - :rtype: - ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1548,7 +1627,7 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( deployment_name=deployment_name, @@ -1582,9 +1661,7 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentDeleteFromResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentDeleteFromResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1592,9 +1669,7 @@ async def _get_deployment_delete_from_resources_status( # pylint: disable=name- return deserialized # type: ignore @distributed_trace_async - async def _get_deployment_status( - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentState: + async def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any) -> _models.DeploymentState: """Gets the status of an existing deployment job. :param deployment_name: Represents deployment name. Required. @@ -1602,7 +1677,7 @@ async def _get_deployment_status( :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._models.DeploymentState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1616,7 +1691,7 @@ async def _get_deployment_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( deployment_name=deployment_name, @@ -1650,9 +1725,7 @@ async def _get_deployment_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2165,7 +2238,7 @@ async def get_next(next_link=None): api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) async def _assign_deployment_resources_initial( - self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2227,21 +2300,64 @@ async def _assign_deployment_resources_initial( return deserialized # type: ignore @overload - async def _begin_assign_deployment_resources( - self, - body: _models._models.AssignDeploymentResourcesDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + async def begin_assign_deployment_resources( + self, body: _models.AssignDeploymentResourcesDetails, *, 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.AssignDeploymentResourcesDetails + :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: + """ + @overload - async def _begin_assign_deployment_resources( + async def begin_assign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_assign_deployment_resources( + async def begin_assign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -2249,8 +2365,8 @@ async def _begin_assign_deployment_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_deployment_resources( - self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_assign_deployment_resources( + self, body: Union[_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 @@ -2260,9 +2376,8 @@ async def _begin_assign_deployment_resources( :param body: The new project resources to be assigned. Is one of the following types: AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: - ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails + or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2314,7 +2429,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 _unassign_deployment_resources_initial( - self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2376,17 +2491,52 @@ async def _unassign_deployment_resources_initial( return deserialized # type: ignore @overload - async def _begin_unassign_deployment_resources( - self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + async def begin_unassign_deployment_resources( + self, body: _models.DeleteDeploymentDetails, *, 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.DeleteDeploymentDetails + :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: + """ + @overload - async def _begin_unassign_deployment_resources( + async def begin_unassign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_unassign_deployment_resources( + async def begin_unassign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -2394,15 +2544,15 @@ async def _begin_unassign_deployment_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_deployment_resources( - self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_unassign_deployment_resources( + self, body: Union[_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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -2454,16 +2604,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_deployment_resources_status( + async def get_assign_deployment_resources_status( self, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentResourcesState: + ) -> _models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2477,7 +2627,7 @@ async def _get_assign_deployment_resources_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_deployment_resources_status_request( job_id=job_id, @@ -2510,9 +2660,7 @@ async def _get_assign_deployment_resources_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2525,16 +2673,16 @@ async def _get_assign_deployment_resources_status( 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_deployment_resources_status( # pylint: disable=name-too-long + async def get_unassign_deployment_resources_status( self, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentResourcesState: + ) -> _models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2548,7 +2696,7 @@ async def _get_unassign_deployment_resources_status( # pylint: disable=name-too _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_deployment_resources_status_request( job_id=job_id, @@ -2581,9 +2729,7 @@ async def _get_unassign_deployment_resources_status( # pylint: disable=name-too if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2591,7 +2737,7 @@ async def _get_unassign_deployment_resources_status( # pylint: disable=name-too return deserialized # type: ignore async def _swap_deployments_initial( - self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2653,28 +2799,63 @@ async def _swap_deployments_initial( return deserialized # type: ignore @overload - async def _begin_swap_deployments( - self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + 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: + """ + @overload - async def _begin_swap_deployments( + async def begin_swap_deployments( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_swap_deployments( + async def begin_swap_deployments( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ @distributed_trace_async - async def _begin_swap_deployments( - self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_swap_deployments( + self, body: Union[_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._models.SwapDeploymentsDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -2721,13 +2902,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._models.SwapDeploymentsState: + async def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _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._models.SwapDeploymentsState + :rtype: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2741,7 +2922,7 @@ async def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) + cls: ClsType[_models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( job_id=job_id, @@ -2774,9 +2955,7 @@ async def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mod if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.SwapDeploymentsState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.SwapDeploymentsState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2784,7 +2963,7 @@ async def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _mod 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 @@ -2842,13 +3021,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._models.ProjectDeletionState: + async def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _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._models.ProjectDeletionState + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeletionState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2862,7 +3041,7 @@ async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ProjectDeletionState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectDeletionState] = kwargs.pop("cls", None) _request = build_project_get_project_deletion_status_request( job_id=job_id, @@ -2894,9 +3073,7 @@ async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mod if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ProjectDeletionState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ProjectDeletionState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2905,9 +3082,9 @@ async def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _mod async def _import_method_initial( self, - body: Union[_models._models.ExportedProject, JSON, IO[bytes]], + body: Union[_models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2971,39 +3148,89 @@ async def _import_method_initial( return deserialized # type: ignore @overload - async def _begin_import_method( + async def begin_import_method( self, - body: _models._models.ExportedProject, + body: _models.ExportedProject, *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_import_method( + async def begin_import_method( self, body: JSON, *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_import_method( + async def begin_import_method( self, body: IO[bytes], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ @distributed_trace_async - async def _begin_import_method( + async def begin_import_method( self, - body: Union[_models._models.ExportedProject, JSON, IO[bytes]], + body: Union[_models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.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 @@ -3011,8 +3238,8 @@ async def _begin_import_method( :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._models.ExportedProject or JSON - or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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 @@ -3072,7 +3299,7 @@ async def _export_initial( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -3131,11 +3358,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._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -3209,13 +3436,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._models.ExportProjectState: + async def get_export_status(self, job_id: str, **kwargs: Any) -> _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._models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3229,7 +3456,7 @@ async def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( job_id=job_id, @@ -3262,9 +3489,7 @@ async def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._model if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3272,7 +3497,7 @@ async def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._model return deserialized # type: ignore @overload - async def _copy_project_authorization( + async def copy_project_authorization( self, *, project_kind: Union[str, _models.ProjectKind], @@ -3280,15 +3505,57 @@ async def _copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ + @overload - async def _copy_project_authorization( + async def copy_project_authorization( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ + @overload - async def _copy_project_authorization( + async def copy_project_authorization( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ @distributed_trace_async @api_version_validation( @@ -3296,7 +3563,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, *, @@ -3304,7 +3571,7 @@ async def _copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models._models.CopyProjectDetails: + ) -> _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. @@ -3319,7 +3586,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._models.CopyProjectDetails + :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3334,7 +3601,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._models.CopyProjectDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.CopyProjectDetails] = kwargs.pop("cls", None) if body is _Unset: if project_kind is _Unset: @@ -3384,9 +3651,7 @@ async def _copy_project_authorization( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.CopyProjectDetails, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.CopyProjectDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3399,7 +3664,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._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3461,17 +3726,52 @@ async def _copy_project_initial( return deserialized # type: ignore @overload - async def _begin_copy_project( - self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + 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: + """ + @overload - async def _begin_copy_project( + async def begin_copy_project( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @overload - async def _begin_copy_project( + async def begin_copy_project( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -3479,15 +3779,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._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_copy_project( + self, body: Union[_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._models.CopyProjectDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -3539,13 +3839,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._models.CopyProjectState: + async def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _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._models.CopyProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3559,7 +3859,7 @@ async def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( job_id=job_id, @@ -3592,9 +3892,7 @@ async def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models. if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.CopyProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.CopyProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3602,7 +3900,7 @@ async def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models. return deserialized # type: ignore async def _train_initial( - self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3664,28 +3962,69 @@ async def _train_initial( return deserialized # type: ignore @overload - async def _begin_train( - self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: ... + 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: + """ + @overload - async def _begin_train( + async def begin_train( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: ... + ) -> 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: + """ + @overload - async def _begin_train( + async def begin_train( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TrainingJobResult]: ... + ) -> 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: + """ @distributed_trace_async - async def _begin_train( - self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + async def begin_train( + self, body: Union[_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._models.TrainingJobDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails or JSON or + IO[bytes] :return: An instance of AsyncLROPoller that returns TrainingJobResult. The TrainingJobResult is compatible with MutableMapping :rtype: @@ -3744,7 +4083,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. @@ -4065,7 +4404,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. @@ -4124,10 +4463,7 @@ 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._models.ExportedModelDetails, JSON, IO[bytes]], - **kwargs: Any + self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4190,22 +4526,63 @@ 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._models.ExportedModelDetails, + body: _models.ExportedModelDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -4213,11 +4590,8 @@ 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._models.ExportedModelDetails, JSON, IO[bytes]], - **kwargs: Any + async def begin_create_or_update_exported_model( + self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Creates a new exported model or replaces an existing one. @@ -4225,8 +4599,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._models.ExportedModelDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -4286,9 +4660,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._models.ExportedModelState: + ) -> _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. @@ -4296,7 +4670,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._models.ExportedModelState + :rtype: ~azure.ai.language.conversations.authoring.models.ExportedModelState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4310,7 +4684,7 @@ async def _get_exported_model_job_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( exported_model_name=exported_model_name, @@ -4344,9 +4718,7 @@ async def _get_exported_model_job_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportedModelState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportedModelState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4552,22 +4924,69 @@ 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._models.EvaluationJobResult]: ... + ) -> 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: + """ + @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._models.EvaluationJobResult]: ... + ) -> 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: + """ + @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._models.EvaluationJobResult]: ... + ) -> 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: + """ @distributed_trace_async @api_version_validation( @@ -4575,9 +4994,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._models.EvaluationJobResult]: + ) -> AsyncLROPoller[_models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. :param trained_model_label: The trained model label. Required. @@ -4589,14 +5008,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._models.EvaluationJobResult] + ~azure.core.polling.AsyncLROPoller[~azure.ai.language.conversations.authoring.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._models.EvaluationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_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) @@ -4620,10 +5039,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize( - _models._models.EvaluationJobResult, # pylint: disable=protected-access - response.json().get("result", {}), - ) + deserialized = _deserialize(_models.EvaluationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -4642,13 +5058,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models._models.EvaluationJobResult].from_continuation_token( + return AsyncLROPoller[_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._models.EvaluationJobResult]( + return AsyncLROPoller[_models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -4704,7 +5120,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. @@ -4765,9 +5181,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._models.EvaluationState: + ) -> _models.EvaluationState: """Gets the status for an evaluation job. :param trained_model_label: The trained model label. Required. @@ -4775,7 +5191,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._models.EvaluationState + :rtype: ~azure.ai.language.conversations.authoring.models.EvaluationState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4789,7 +5205,7 @@ async def _get_evaluation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( trained_model_label=trained_model_label, @@ -4823,9 +5239,7 @@ async def _get_evaluation_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.EvaluationState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.EvaluationState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5006,9 +5420,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._models.LoadSnapshotState: + ) -> _models.LoadSnapshotState: """Gets the status for loading a snapshot. :param trained_model_label: The trained model label. Required. @@ -5016,7 +5430,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._models.LoadSnapshotState + :rtype: ~azure.ai.language.conversations.authoring.models.LoadSnapshotState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5030,7 +5444,7 @@ async def _get_load_snapshot_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) + cls: ClsType[_models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( trained_model_label=trained_model_label, @@ -5064,9 +5478,7 @@ async def _get_load_snapshot_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.LoadSnapshotState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.LoadSnapshotState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore 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 6115d15497a5..8e8ad79d4dd7 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,27 +14,74 @@ from ._models import ( # type: ignore + AssignDeploymentResourcesDetails, AssignedDeploymentResource, AssignedProjectDeploymentMetadata, AssignedProjectDeploymentsMetadata, ConfusionMatrixCell, ConfusionMatrixRow, + ConversationExportedAssociatedEntityLabel, + ConversationExportedEntity, + ConversationExportedIntent, + ConversationExportedProjectAsset, + ConversationExportedUtterance, + CopyProjectDetails, + CopyProjectState, + CreateDeploymentDetails, CreateProjectOptions, + DataGenerationConnectionInfo, + DataGenerationSettings, + DeleteDeploymentDetails, + DeploymentDeleteFromResourcesState, + DeploymentResource, + DeploymentResourcesState, + 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, ProjectSettings, ProjectTrainedModel, + ResourceMetadata, SubTrainingState, SupportedLanguage, + SwapDeploymentsDetails, + SwapDeploymentsState, TrainingConfigVersion, + TrainingJobDetails, TrainingJobResult, TrainingState, UtteranceEntitiesEvaluationResult, @@ -44,8 +91,13 @@ ) from ._enums import ( # type: ignore + CompositionMode, + DataGenerationConnectionKind, + DatasetType, EvaluationKind, + ExportedProjectFormat, OperationStatus, + OrchestrationTargetProjectKind, ProjectKind, StringIndexType, TrainingMode, @@ -55,35 +107,87 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "AssignDeploymentResourcesDetails", "AssignedDeploymentResource", "AssignedProjectDeploymentMetadata", "AssignedProjectDeploymentsMetadata", "ConfusionMatrixCell", "ConfusionMatrixRow", + "ConversationExportedAssociatedEntityLabel", + "ConversationExportedEntity", + "ConversationExportedIntent", + "ConversationExportedProjectAsset", + "ConversationExportedUtterance", + "CopyProjectDetails", + "CopyProjectState", + "CreateDeploymentDetails", "CreateProjectOptions", + "DataGenerationConnectionInfo", + "DataGenerationSettings", + "DeleteDeploymentDetails", + "DeploymentDeleteFromResourcesState", + "DeploymentResource", + "DeploymentResourcesState", + "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", "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 588388782d2a..8d8ed203f559 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 @@ -24,11 +24,10 @@ class AssignDeploymentResourcesDetails(_Model): """Represents the payload for assigning Azure resources to a project. :ivar metadata: Represents the metadata for the project resources to be assigned. Required. - :vartype metadata: - list[~azure.ai.language.conversations.authoring.models._models.ResourceMetadata] + :vartype metadata: list[~azure.ai.language.conversations.authoring.models.ResourceMetadata] """ - metadata: list["_models._models.ResourceMetadata"] = rest_field( + metadata: list["_models.ResourceMetadata"] = rest_field( name="projectResources", visibility=["read", "create", "update", "delete", "query"] ) """Represents the metadata for the project resources to be assigned. Required.""" @@ -37,7 +36,7 @@ class AssignDeploymentResourcesDetails(_Model): def __init__( self, *, - metadata: list["_models._models.ResourceMetadata"], + metadata: list["_models.ResourceMetadata"], ) -> None: ... @overload @@ -240,12 +239,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._models.ExportedEntityList + :vartype entities: ~azure.ai.language.conversations.authoring.models.ExportedEntityList :ivar prebuilts: The prebuilt entities components. :vartype prebuilts: - list[~azure.ai.language.conversations.authoring.models._models.ExportedPrebuiltEntity] + list[~azure.ai.language.conversations.authoring.models.ExportedPrebuiltEntity] :ivar regex: The regex component of the entity. - :vartype regex: ~azure.ai.language.conversations.authoring.models._models.ExportedEntityRegex + :vartype regex: ~azure.ai.language.conversations.authoring.models.ExportedEntityRegex :ivar required_components: The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. :vartype required_components: list[str] @@ -255,21 +254,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._enums.CompositionMode"]] = rest_field( + composition_mode: Optional[Union[str, "_models.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._models.ExportedEntityList"] = rest_field( + entities: Optional["_models.ExportedEntityList"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The list component of the entity.""" - prebuilts: Optional[list["_models._models.ExportedPrebuiltEntity"]] = rest_field( + prebuilts: Optional[list["_models.ExportedPrebuiltEntity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The prebuilt entities components.""" - regex: Optional["_models._models.ExportedEntityRegex"] = rest_field( + regex: Optional["_models.ExportedEntityRegex"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The regex component of the entity.""" @@ -284,10 +283,10 @@ def __init__( *, category: str, description: Optional[str] = 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, + composition_mode: Optional[Union[str, "_models.CompositionMode"]] = None, + entities: Optional["_models.ExportedEntityList"] = None, + prebuilts: Optional[list["_models.ExportedPrebuiltEntity"]] = None, + regex: Optional["_models.ExportedEntityRegex"] = None, required_components: Optional[list[str]] = None, ) -> None: ... @@ -311,14 +310,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._models.ConversationExportedAssociatedEntityLabel] + list[~azure.ai.language.conversations.authoring.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._models.ConversationExportedAssociatedEntityLabel"]] = rest_field( + associated_entities: Optional[list["_models.ConversationExportedAssociatedEntityLabel"]] = rest_field( name="associatedEntities", visibility=["read", "create", "update", "delete", "query"] ) """The list of associated entities.""" @@ -329,7 +328,7 @@ def __init__( *, category: str, description: Optional[str] = None, - associated_entities: Optional[list["_models._models.ConversationExportedAssociatedEntityLabel"]] = None, + associated_entities: Optional[list["_models.ConversationExportedAssociatedEntityLabel"]] = None, ) -> None: ... @overload @@ -384,27 +383,27 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv :ivar intents: The intents defined in the project. :vartype intents: - list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedIntent] + list[~azure.ai.language.conversations.authoring.models.ConversationExportedIntent] :ivar entities: The entities defined in the project. :vartype entities: - list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedEntity] + list[~azure.ai.language.conversations.authoring.models.ConversationExportedEntity] :ivar utterances: The utterances defined in the project. :vartype utterances: - list[~azure.ai.language.conversations.authoring.models._models.ConversationExportedUtterance] + list[~azure.ai.language.conversations.authoring.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._models.ConversationExportedIntent"]] = rest_field( + intents: Optional[list["_models.ConversationExportedIntent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The intents defined in the project.""" - entities: Optional[list["_models._models.ConversationExportedEntity"]] = rest_field( + entities: Optional[list["_models.ConversationExportedEntity"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The entities defined in the project.""" - utterances: Optional[list["_models._models.ConversationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models.ConversationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The utterances defined in the project.""" @@ -416,9 +415,9 @@ class ConversationExportedProjectAsset(ExportedProjectAsset, discriminator="Conv def __init__( self, *, - intents: Optional[list["_models._models.ConversationExportedIntent"]] = None, - entities: Optional[list["_models._models.ConversationExportedEntity"]] = None, - utterances: Optional[list["_models._models.ConversationExportedUtterance"]] = None, + intents: Optional[list["_models.ConversationExportedIntent"]] = None, + entities: Optional[list["_models.ConversationExportedEntity"]] = None, + utterances: Optional[list["_models.ConversationExportedUtterance"]] = None, ) -> None: ... @overload @@ -438,7 +437,7 @@ class ConversationExportedUtterance(_Model): :ivar entities: Represents the entity labels of the utterance. :vartype entities: - list[~azure.ai.language.conversations.authoring.models._models.ExportedUtteranceEntityLabel] + list[~azure.ai.language.conversations.authoring.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 @@ -451,7 +450,7 @@ class ConversationExportedUtterance(_Model): :vartype dataset: str or ~azure.ai.language.conversations.authoring.models.DatasetType """ - entities: Optional[list["_models._models.ExportedUtteranceEntityLabel"]] = rest_field( + entities: Optional[list["_models.ExportedUtteranceEntityLabel"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the entity labels of the utterance.""" @@ -462,7 +461,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._enums.DatasetType"]] = rest_field( + dataset: Optional[Union[str, "_models.DatasetType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The dataset for this utterance. Allowed values are 'Train' and 'Test'. Known values are: @@ -474,9 +473,9 @@ def __init__( *, text: str, intent: str, - entities: Optional[list["_models._models.ExportedUtteranceEntityLabel"]] = None, + entities: Optional[list["_models.ExportedUtteranceEntityLabel"]] = None, language: Optional[str] = None, - dataset: Optional[Union[str, "_models._enums.DatasetType"]] = None, + dataset: Optional[Union[str, "_models.DatasetType"]] = None, ) -> None: ... @overload @@ -631,14 +630,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._models.DeploymentResource] + list[~azure.ai.language.conversations.authoring.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._models.DeploymentResource"]] = rest_field( + assigned_resources: Optional[list["_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 @@ -650,7 +649,7 @@ def __init__( self, *, trained_model_label: str, - assigned_resources: Optional[list["_models._models.DeploymentResource"]] = None, + assigned_resources: Optional[list["_models.DeploymentResource"]] = None, ) -> None: ... @overload @@ -748,7 +747,7 @@ class DataGenerationConnectionInfo(_Model): :vartype resource_id: str """ - kind: Union[str, "_models._enums.DataGenerationConnectionKind"] = rest_field( + kind: Union[str, "_models.DataGenerationConnectionKind"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Connection type for data generation settings. Currently only supports Azure OpenAI. Required. @@ -765,7 +764,7 @@ class DataGenerationConnectionInfo(_Model): def __init__( self, *, - kind: Union[str, "_models._enums.DataGenerationConnectionKind"], + kind: Union[str, "_models.DataGenerationConnectionKind"], deployment_name: str, resource_id: Optional[str] = None, ) -> None: ... @@ -790,14 +789,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._models.DataGenerationConnectionInfo + ~azure.ai.language.conversations.authoring.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._models.DataGenerationConnectionInfo" = rest_field( + data_generation_connection_info: "_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.""" @@ -807,7 +806,7 @@ def __init__( self, *, enable_data_generation: bool, - data_generation_connection_info: "_models._models.DataGenerationConnectionInfo", + data_generation_connection_info: "_models.DataGenerationConnectionInfo", ) -> None: ... @overload @@ -929,14 +928,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._models.DataGenerationConnectionInfo + ~azure.ai.language.conversations.authoring.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._models.DataGenerationConnectionInfo"] = rest_field( + assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = rest_field( name="assignedAoaiResource", visibility=["read", "create", "update", "delete", "query"] ) """Represents the AOAI resource assigned for data generation.""" @@ -947,7 +946,7 @@ def __init__( *, resource_id: str, region: str, - assigned_aoai_resource: Optional["_models._models.DataGenerationConnectionInfo"] = None, + assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = None, ) -> None: ... @overload @@ -1409,7 +1408,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._models.EvaluationJobResult + :vartype result: ~azure.ai.language.conversations.authoring.models.EvaluationJobResult """ job_id: str = rest_field(name="jobId", visibility=["read"]) @@ -1435,9 +1434,7 @@ 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._models.EvaluationJobResult" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + result: "_models.EvaluationJobResult" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Represents evaluation task detailed result. Required.""" @overload @@ -1447,7 +1444,7 @@ def __init__( created_on: datetime.datetime, last_updated_on: datetime.datetime, status: Union[str, "_models.OperationStatus"], - result: "_models._models.EvaluationJobResult", + result: "_models.EvaluationJobResult", expires_on: Optional[datetime.datetime] = None, warnings: Optional[list[ODataV4Format]] = None, errors: Optional[list[ODataV4Format]] = None, @@ -1539,13 +1536,13 @@ class ExportedConversationOrchestrationDetails(ExportedOrchestrationDetails, dis :ivar conversation_orchestration: The Conversational project target details. Required. :vartype conversation_orchestration: - ~azure.ai.language.conversations.authoring.models._models.ExportedConversationOrchestration + ~azure.ai.language.conversations.authoring.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._models.ExportedConversationOrchestration" = rest_field( + conversation_orchestration: "_models.ExportedConversationOrchestration" = rest_field( name="conversationOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The Conversational project target details. Required.""" @@ -1556,7 +1553,7 @@ class ExportedConversationOrchestrationDetails(ExportedOrchestrationDetails, dis def __init__( self, *, - conversation_orchestration: "_models._models.ExportedConversationOrchestration", + conversation_orchestration: "_models.ExportedConversationOrchestration", ) -> None: ... @overload @@ -1576,10 +1573,10 @@ class ExportedEntityList(_Model): :ivar sublists: The sub-lists of the list component. :vartype sublists: - list[~azure.ai.language.conversations.authoring.models._models.ExportedEntitySublist] + list[~azure.ai.language.conversations.authoring.models.ExportedEntitySublist] """ - sublists: Optional[list["_models._models.ExportedEntitySublist"]] = rest_field( + sublists: Optional[list["_models.ExportedEntitySublist"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The sub-lists of the list component.""" @@ -1588,7 +1585,7 @@ class ExportedEntityList(_Model): def __init__( self, *, - sublists: Optional[list["_models._models.ExportedEntitySublist"]] = None, + sublists: Optional[list["_models.ExportedEntitySublist"]] = None, ) -> None: ... @overload @@ -1647,10 +1644,10 @@ class ExportedEntityRegex(_Model): `https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions `_. :vartype expressions: - list[~azure.ai.language.conversations.authoring.models._models.ExportedEntityRegexExpression] + list[~azure.ai.language.conversations.authoring.models.ExportedEntityRegexExpression] """ - expressions: Optional[list["_models._models.ExportedEntityRegexExpression"]] = rest_field( + expressions: Optional[list["_models.ExportedEntityRegexExpression"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The regex expressions of the regex component. These expressions follow the .NET regex syntax. @@ -1662,7 +1659,7 @@ class ExportedEntityRegex(_Model): def __init__( self, *, - expressions: Optional[list["_models._models.ExportedEntityRegexExpression"]] = None, + expressions: Optional[list["_models.ExportedEntityRegexExpression"]] = None, ) -> None: ... @overload @@ -1729,12 +1726,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._models.ExportedEntityListSynonym] + list[~azure.ai.language.conversations.authoring.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._models.ExportedEntityListSynonym"]] = rest_field( + synonyms: Optional[list["_models.ExportedEntityListSynonym"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The phrases of that correspond to the sub-list.""" @@ -1744,7 +1741,7 @@ def __init__( self, *, list_key: Optional[str] = None, - synonyms: Optional[list["_models._models.ExportedEntityListSynonym"]] = None, + synonyms: Optional[list["_models.ExportedEntityListSynonym"]] = None, ) -> None: ... @overload @@ -1803,12 +1800,12 @@ class ExportedLuisOrchestrationDetails(ExportedOrchestrationDetails, discriminat :ivar luis_orchestration: The LUIS application target details. Required. :vartype luis_orchestration: - ~azure.ai.language.conversations.authoring.models._models.ExportedLuisOrchestration + ~azure.ai.language.conversations.authoring.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._models.ExportedLuisOrchestration" = rest_field( + luis_orchestration: "_models.ExportedLuisOrchestration" = rest_field( name="luisOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The LUIS application target details. Required.""" @@ -1819,7 +1816,7 @@ class ExportedLuisOrchestrationDetails(ExportedOrchestrationDetails, discriminat def __init__( self, *, - luis_orchestration: "_models._models.ExportedLuisOrchestration", + luis_orchestration: "_models.ExportedLuisOrchestration", ) -> None: ... @overload @@ -1973,7 +1970,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._models.ExportedProjectAsset + :vartype assets: ~azure.ai.language.conversations.authoring.models.ExportedProjectAsset """ project_file_version: str = rest_field( @@ -1988,7 +1985,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._models.ExportedProjectAsset"] = rest_field( + assets: Optional["_models.ExportedProjectAsset"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the project assets.""" @@ -2000,7 +1997,7 @@ def __init__( project_file_version: str, string_index_type: Union[str, "_models.StringIndexType"], metadata: "_models.CreateProjectOptions", - assets: Optional["_models._models.ExportedProjectAsset"] = None, + assets: Optional["_models.ExportedProjectAsset"] = None, ) -> None: ... @overload @@ -2049,13 +2046,13 @@ class ExportedQuestionAnsweringOrchestrationDetails( :ivar question_answering_orchestration: The Question Answering project details. Required. :vartype question_answering_orchestration: - ~azure.ai.language.conversations.authoring.models._models.ExportedQuestionAnsweringOrchestration + ~azure.ai.language.conversations.authoring.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._models.ExportedQuestionAnsweringOrchestration" = rest_field( + question_answering_orchestration: "_models.ExportedQuestionAnsweringOrchestration" = rest_field( name="questionAnsweringOrchestration", visibility=["read", "create", "update", "delete", "query"] ) """The Question Answering project details. Required.""" @@ -2066,7 +2063,7 @@ class ExportedQuestionAnsweringOrchestrationDetails( def __init__( self, *, - question_answering_orchestration: "_models._models.ExportedQuestionAnsweringOrchestration", + question_answering_orchestration: "_models.ExportedQuestionAnsweringOrchestration", ) -> None: ... @overload @@ -2538,14 +2535,14 @@ class OrchestrationExportedIntent(_Model): :ivar orchestration: Specifies the behavior of this intent in the orchestration flow. :vartype orchestration: - ~azure.ai.language.conversations.authoring.models._models.ExportedOrchestrationDetails + ~azure.ai.language.conversations.authoring.models.ExportedOrchestrationDetails :ivar category: The intent category. Required. :vartype category: str :ivar description: The intent description. :vartype description: str """ - orchestration: Optional["_models._models.ExportedOrchestrationDetails"] = rest_field( + orchestration: Optional["_models.ExportedOrchestrationDetails"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Specifies the behavior of this intent in the orchestration flow.""" @@ -2559,7 +2556,7 @@ def __init__( self, *, category: str, - orchestration: Optional["_models._models.ExportedOrchestrationDetails"] = None, + orchestration: Optional["_models.ExportedOrchestrationDetails"] = None, description: Optional[str] = None, ) -> None: ... @@ -2579,21 +2576,21 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc :ivar intents: Represents the intents of the project. :vartype intents: - list[~azure.ai.language.conversations.authoring.models._models.OrchestrationExportedIntent] + list[~azure.ai.language.conversations.authoring.models.OrchestrationExportedIntent] :ivar utterances: Represents the utterances of the project. :vartype utterances: - list[~azure.ai.language.conversations.authoring.models._models.OrchestrationExportedUtterance] + list[~azure.ai.language.conversations.authoring.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._models.OrchestrationExportedIntent"]] = rest_field( + intents: Optional[list["_models.OrchestrationExportedIntent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the intents of the project.""" - utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = rest_field( + utterances: Optional[list["_models.OrchestrationExportedUtterance"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Represents the utterances of the project.""" @@ -2605,8 +2602,8 @@ class OrchestrationExportedProjectAsset(ExportedProjectAsset, discriminator="Orc def __init__( self, *, - intents: Optional[list["_models._models.OrchestrationExportedIntent"]] = None, - utterances: Optional[list["_models._models.OrchestrationExportedUtterance"]] = None, + intents: Optional[list["_models.OrchestrationExportedIntent"]] = None, + utterances: Optional[list["_models.OrchestrationExportedUtterance"]] = None, ) -> None: ... @overload @@ -3316,7 +3313,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._models.DataGenerationSettings + ~azure.ai.language.conversations.authoring.models.DataGenerationSettings """ model_label: str = rest_field(name="modelLabel", visibility=["read", "create", "update", "delete", "query"]) @@ -3336,7 +3333,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._models.DataGenerationSettings"] = rest_field( + data_generation_settings: Optional["_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.""" @@ -3349,7 +3346,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._models.DataGenerationSettings"] = None, + data_generation_settings: Optional["_models.DataGenerationSettings"] = None, ) -> None: ... @overload 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 fd8cab17d697..1ab900440bcb 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 @@ -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._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.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._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.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._models.ExportProjectState: + def get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _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) -> _ :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._models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.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) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_export_status_request( project_name=project_name, @@ -2306,9 +2306,7 @@ def _get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2316,7 +2314,7 @@ def _get_export_status(self, project_name: str, job_id: str, **kwargs: Any) -> _ return deserialized # type: ignore @distributed_trace - def _get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models._models.ImportProjectState: + def get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _models.ImportProjectState: """Gets the status for an import. :param project_name: The new project name. Required. @@ -2324,7 +2322,7 @@ 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._models.ImportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.ImportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2338,7 +2336,7 @@ 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._models.ImportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ImportProjectState] = kwargs.pop("cls", None) _request = build_conversation_authoring_get_import_status_request( project_name=project_name, @@ -2371,9 +2369,7 @@ def _get_import_status(self, project_name: str, job_id: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ImportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ImportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2462,7 +2458,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._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2525,26 +2521,67 @@ def _deploy_project_initial( return deserialized # type: ignore @overload - def _begin_deploy_project( + def begin_deploy_project( self, deployment_name: str, - body: _models._models.CreateDeploymentDetails, + body: _models.CreateDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_deploy_project( + def begin_deploy_project( self, deployment_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace - def _begin_deploy_project( - self, deployment_name: str, body: Union[_models._models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + def begin_deploy_project( + self, deployment_name: str, body: Union[_models.CreateDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Creates a new deployment or replaces an existing one. @@ -2552,8 +2589,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._models.CreateDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -2656,7 +2693,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. @@ -2710,7 +2747,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._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2773,22 +2810,69 @@ 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._models.DeleteDeploymentDetails, + body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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.DeleteDeploymentDetails + :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: + """ + @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]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -2796,8 +2880,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._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + def begin_delete_deployment_from_resources( + self, deployment_name: str, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -2806,8 +2890,8 @@ def _begin_delete_deployment_from_resources( :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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -2864,9 +2948,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._models.DeploymentDeleteFromResourcesState: + ) -> _models.DeploymentDeleteFromResourcesState: """Gets the status of an existing delete deployment from specific resources job. :param deployment_name: Represents deployment name. Required. @@ -2875,8 +2959,7 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo :type job_id: str :return: DeploymentDeleteFromResourcesState. The DeploymentDeleteFromResourcesState is compatible with MutableMapping - :rtype: - ~azure.ai.language.conversations.authoring.models._models.DeploymentDeleteFromResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentDeleteFromResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2890,7 +2973,7 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentDeleteFromResourcesState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_delete_from_resources_status_request( deployment_name=deployment_name, @@ -2924,9 +3007,7 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentDeleteFromResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentDeleteFromResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2934,9 +3015,7 @@ def _get_deployment_delete_from_resources_status( # pylint: disable=name-too-lo return deserialized # type: ignore @distributed_trace - def _get_deployment_status( - self, deployment_name: str, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentState: + def get_deployment_status(self, deployment_name: str, job_id: str, **kwargs: Any) -> _models.DeploymentState: """Gets the status of an existing deployment job. :param deployment_name: Represents deployment name. Required. @@ -2944,7 +3023,7 @@ def _get_deployment_status( :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._models.DeploymentState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2958,7 +3037,7 @@ def _get_deployment_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentState] = kwargs.pop("cls", None) _request = build_deployment_get_deployment_status_request( deployment_name=deployment_name, @@ -2992,9 +3071,7 @@ def _get_deployment_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3507,7 +3584,7 @@ def get_next(next_link=None): api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def _assign_deployment_resources_initial( - self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3569,21 +3646,64 @@ def _assign_deployment_resources_initial( return deserialized # type: ignore @overload - def _begin_assign_deployment_resources( - self, - body: _models._models.AssignDeploymentResourcesDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: ... + def begin_assign_deployment_resources( + self, body: _models.AssignDeploymentResourcesDetails, *, 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.AssignDeploymentResourcesDetails + :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: + """ + @overload - def _begin_assign_deployment_resources( + def begin_assign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_assign_deployment_resources( + def begin_assign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -3591,8 +3711,8 @@ def _begin_assign_deployment_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_deployment_resources( - self, body: Union[_models._models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + def begin_assign_deployment_resources( + self, body: Union[_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 @@ -3602,9 +3722,8 @@ def _begin_assign_deployment_resources( :param body: The new project resources to be assigned. Is one of the following types: AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: - ~azure.ai.language.conversations.authoring.models._models.AssignDeploymentResourcesDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails + or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3655,7 +3774,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 _unassign_deployment_resources_initial( - self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3717,17 +3836,52 @@ def _unassign_deployment_resources_initial( return deserialized # type: ignore @overload - def _begin_unassign_deployment_resources( - self, body: _models._models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + def begin_unassign_deployment_resources( + self, body: _models.DeleteDeploymentDetails, *, 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.DeleteDeploymentDetails + :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: + """ + @overload - def _begin_unassign_deployment_resources( + def begin_unassign_deployment_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_unassign_deployment_resources( + def begin_unassign_deployment_resources( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -3735,15 +3889,15 @@ def _begin_unassign_deployment_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_deployment_resources( - self, body: Union[_models._models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + def begin_unassign_deployment_resources( + self, body: Union[_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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models._models.DeleteDeploymentDetails - or JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -3794,16 +3948,14 @@ 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_deployment_resources_status( - self, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentResourcesState: + def get_assign_deployment_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3817,7 +3969,7 @@ def _get_assign_deployment_resources_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_deployment_resources_status_request( job_id=job_id, @@ -3850,9 +4002,7 @@ def _get_assign_deployment_resources_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3865,16 +4015,14 @@ def _get_assign_deployment_resources_status( 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_deployment_resources_status( # pylint: disable=name-too-long - self, job_id: str, **kwargs: Any - ) -> _models._models.DeploymentResourcesState: + def get_unassign_deployment_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models._models.DeploymentResourcesState + :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3888,7 +4036,7 @@ def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_deployment_resources_status_request( job_id=job_id, @@ -3921,9 +4069,7 @@ def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.DeploymentResourcesState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3931,7 +4077,7 @@ def _get_unassign_deployment_resources_status( # pylint: disable=name-too-long return deserialized # type: ignore def _swap_deployments_initial( - self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3993,28 +4139,63 @@ def _swap_deployments_initial( return deserialized # type: ignore @overload - def _begin_swap_deployments( - self, body: _models._models.SwapDeploymentsDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + 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: + """ + @overload - def _begin_swap_deployments( + def begin_swap_deployments( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_swap_deployments( + def begin_swap_deployments( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ @distributed_trace - def _begin_swap_deployments( - self, body: Union[_models._models.SwapDeploymentsDetails, JSON, IO[bytes]], **kwargs: Any + def begin_swap_deployments( + self, body: Union[_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._models.SwapDeploymentsDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -4060,13 +4241,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._models.SwapDeploymentsState: + def get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _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._models.SwapDeploymentsState + :rtype: ~azure.ai.language.conversations.authoring.models.SwapDeploymentsState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4080,7 +4261,7 @@ def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models._m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.SwapDeploymentsState] = kwargs.pop("cls", None) + cls: ClsType[_models.SwapDeploymentsState] = kwargs.pop("cls", None) _request = build_project_get_swap_deployments_status_request( job_id=job_id, @@ -4113,9 +4294,7 @@ def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models._m if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.SwapDeploymentsState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.SwapDeploymentsState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4123,7 +4302,7 @@ def _get_swap_deployments_status(self, job_id: str, **kwargs: Any) -> _models._m 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 @@ -4181,13 +4360,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._models.ProjectDeletionState: + def get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _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._models.ProjectDeletionState + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectDeletionState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4201,7 +4380,7 @@ def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ProjectDeletionState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectDeletionState] = kwargs.pop("cls", None) _request = build_project_get_project_deletion_status_request( job_id=job_id, @@ -4233,9 +4412,7 @@ def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._m if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ProjectDeletionState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ProjectDeletionState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4244,9 +4421,9 @@ def _get_project_deletion_status(self, job_id: str, **kwargs: Any) -> _models._m def _import_method_initial( self, - body: Union[_models._models.ExportedProject, JSON, IO[bytes]], + body: Union[_models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4310,39 +4487,89 @@ def _import_method_initial( return deserialized # type: ignore @overload - def _begin_import_method( + def begin_import_method( self, - body: _models._models.ExportedProject, + body: _models.ExportedProject, *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_import_method( + def begin_import_method( self, body: JSON, *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_import_method( + def begin_import_method( self, body: IO[bytes], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ @distributed_trace - def _begin_import_method( + def begin_import_method( self, - body: Union[_models._models.ExportedProject, JSON, IO[bytes]], + body: Union[_models.ExportedProject, JSON, IO[bytes]], *, - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.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 @@ -4350,8 +4577,8 @@ def _begin_import_method( :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._models.ExportedProject or JSON - or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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 @@ -4410,7 +4637,7 @@ def _export_initial( self, *, string_index_type: Union[str, _models.StringIndexType], - exported_project_format: Optional[Union[str, _models._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -4469,11 +4696,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._enums.ExportedProjectFormat]] = None, + exported_project_format: Optional[Union[str, _models.ExportedProjectFormat]] = None, asset_kind: Optional[str] = None, trained_model_label: Optional[str] = None, **kwargs: Any @@ -4546,13 +4773,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._models.ExportProjectState: + def get_export_status(self, job_id: str, **kwargs: Any) -> _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._models.ExportProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.ExportProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4566,7 +4793,7 @@ def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._models.Expo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportProjectState] = kwargs.pop("cls", None) _request = build_project_get_export_status_request( job_id=job_id, @@ -4599,9 +4826,7 @@ def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._models.Expo if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4609,7 +4834,7 @@ def _get_export_status(self, job_id: str, **kwargs: Any) -> _models._models.Expo return deserialized # type: ignore @overload - def _copy_project_authorization( + def copy_project_authorization( self, *, project_kind: Union[str, _models.ProjectKind], @@ -4617,15 +4842,57 @@ def _copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ + @overload - def _copy_project_authorization( + def copy_project_authorization( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ + @overload - def _copy_project_authorization( + def copy_project_authorization( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models._models.CopyProjectDetails: ... + ) -> _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: + """ @distributed_trace @api_version_validation( @@ -4633,7 +4900,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, *, @@ -4641,7 +4908,7 @@ def _copy_project_authorization( storage_input_container_name: Optional[str] = None, allow_overwrite: Optional[bool] = None, **kwargs: Any - ) -> _models._models.CopyProjectDetails: + ) -> _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. @@ -4656,7 +4923,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._models.CopyProjectDetails + :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4671,7 +4938,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._models.CopyProjectDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.CopyProjectDetails] = kwargs.pop("cls", None) if body is _Unset: if project_kind is _Unset: @@ -4721,9 +4988,7 @@ def _copy_project_authorization( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.CopyProjectDetails, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.CopyProjectDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4736,7 +5001,7 @@ def _copy_project_authorization( api_versions_list=["2025-05-15-preview", "2025-11-15-preview"], ) def _copy_project_initial( - self, body: Union[_models._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4798,17 +5063,52 @@ def _copy_project_initial( return deserialized # type: ignore @overload - def _begin_copy_project( - self, body: _models._models.CopyProjectDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + 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: + """ + @overload - def _begin_copy_project( + def begin_copy_project( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @overload - def _begin_copy_project( + def begin_copy_project( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -4816,15 +5116,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._models.CopyProjectDetails, JSON, IO[bytes]], **kwargs: Any + def begin_copy_project( + self, body: Union[_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._models.CopyProjectDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -4875,13 +5175,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._models.CopyProjectState: + def get_copy_project_status(self, job_id: str, **kwargs: Any) -> _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._models.CopyProjectState + :rtype: ~azure.ai.language.conversations.authoring.models.CopyProjectState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4895,7 +5195,7 @@ def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models._model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.CopyProjectState] = kwargs.pop("cls", None) + cls: ClsType[_models.CopyProjectState] = kwargs.pop("cls", None) _request = build_project_get_copy_project_status_request( job_id=job_id, @@ -4928,9 +5228,7 @@ def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models._model if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.CopyProjectState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.CopyProjectState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4938,7 +5236,7 @@ def _get_copy_project_status(self, job_id: str, **kwargs: Any) -> _models._model return deserialized # type: ignore def _train_initial( - self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5000,28 +5298,69 @@ def _train_initial( return deserialized # type: ignore @overload - def _begin_train( - self, body: _models._models.TrainingJobDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: ... + 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: + """ + @overload - def _begin_train( + def begin_train( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: ... + ) -> 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: + """ + @overload - def _begin_train( + def begin_train( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TrainingJobResult]: ... + ) -> 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: + """ @distributed_trace - def _begin_train( - self, body: Union[_models._models.TrainingJobDetails, JSON, IO[bytes]], **kwargs: Any + def begin_train( + self, body: Union[_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._models.TrainingJobDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.models.TrainingJobDetails or JSON or + IO[bytes] :return: An instance of LROPoller that returns TrainingJobResult. The TrainingJobResult is compatible with MutableMapping :rtype: @@ -5079,7 +5418,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. @@ -5399,7 +5738,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. @@ -5457,10 +5796,7 @@ 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._models.ExportedModelDetails, JSON, IO[bytes]], - **kwargs: Any + self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5523,22 +5859,63 @@ 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._models.ExportedModelDetails, + body: _models.ExportedModelDetails, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ + @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]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -5546,11 +5923,8 @@ 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._models.ExportedModelDetails, JSON, IO[bytes]], - **kwargs: Any + def begin_create_or_update_exported_model( + self, exported_model_name: str, body: Union[_models.ExportedModelDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Creates a new exported model or replaces an existing one. @@ -5558,8 +5932,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._models.ExportedModelDetails or - JSON or IO[bytes] + :type body: ~azure.ai.language.conversations.authoring.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: @@ -5618,9 +5992,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._models.ExportedModelState: + ) -> _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. @@ -5628,7 +6002,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._models.ExportedModelState + :rtype: ~azure.ai.language.conversations.authoring.models.ExportedModelState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5642,7 +6016,7 @@ def _get_exported_model_job_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.ExportedModelState] = kwargs.pop("cls", None) + cls: ClsType[_models.ExportedModelState] = kwargs.pop("cls", None) _request = build_exported_model_get_exported_model_job_status_request( exported_model_name=exported_model_name, @@ -5676,9 +6050,7 @@ def _get_exported_model_job_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.ExportedModelState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.ExportedModelState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5886,22 +6258,69 @@ 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._models.EvaluationJobResult]: ... + ) -> 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: + """ + @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._models.EvaluationJobResult]: ... + ) -> 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: + """ + @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._models.EvaluationJobResult]: ... + ) -> 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: + """ @distributed_trace @api_version_validation( @@ -5909,9 +6328,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._models.EvaluationJobResult]: + ) -> LROPoller[_models.EvaluationJobResult]: """Triggers evaluation operation on a trained model. :param trained_model_label: The trained model label. Required. @@ -5923,14 +6342,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._models.EvaluationJobResult] + ~azure.core.polling.LROPoller[~azure.ai.language.conversations.authoring.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._models.EvaluationJobResult] = kwargs.pop("cls", None) + cls: ClsType[_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) @@ -5954,10 +6373,7 @@ def get_long_running_output(pipeline_response): "str", response.headers.get("Operation-Location") ) - deserialized = _deserialize( - _models._models.EvaluationJobResult, # pylint: disable=protected-access - response.json().get("result", {}), - ) + deserialized = _deserialize(_models.EvaluationJobResult, response.json().get("result", {})) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized @@ -5975,13 +6391,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models._models.EvaluationJobResult].from_continuation_token( + return LROPoller[_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._models.EvaluationJobResult]( + return LROPoller[_models.EvaluationJobResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -6037,7 +6453,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. @@ -6097,9 +6513,7 @@ 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._models.EvaluationState: + def get_evaluation_status(self, trained_model_label: str, job_id: str, **kwargs: Any) -> _models.EvaluationState: """Gets the status for an evaluation job. :param trained_model_label: The trained model label. Required. @@ -6107,7 +6521,7 @@ 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._models.EvaluationState + :rtype: ~azure.ai.language.conversations.authoring.models.EvaluationState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6121,7 +6535,7 @@ def _get_evaluation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.EvaluationState] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationState] = kwargs.pop("cls", None) _request = build_trained_model_get_evaluation_status_request( trained_model_label=trained_model_label, @@ -6155,9 +6569,7 @@ def _get_evaluation_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.EvaluationState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.EvaluationState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6338,9 +6750,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._models.LoadSnapshotState: + ) -> _models.LoadSnapshotState: """Gets the status for loading a snapshot. :param trained_model_label: The trained model label. Required. @@ -6348,7 +6760,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._models.LoadSnapshotState + :rtype: ~azure.ai.language.conversations.authoring.models.LoadSnapshotState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6362,7 +6774,7 @@ def _get_load_snapshot_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models._models.LoadSnapshotState] = kwargs.pop("cls", None) + cls: ClsType[_models.LoadSnapshotState] = kwargs.pop("cls", None) _request = build_trained_model_get_load_snapshot_status_request( trained_model_label=trained_model_label, @@ -6396,9 +6808,7 @@ def _get_load_snapshot_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize( - _models._models.LoadSnapshotState, response.json() # pylint: disable=protected-access - ) + deserialized = _deserialize(_models.LoadSnapshotState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml index 71f28fbbb24c..21e9e3d2876d 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/pyproject.toml @@ -1,14 +1,18 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + [build-system] -requires = [ - "setuptools>=77.0.3", - "wheel", -] +requires = ["setuptools>=77.0.3", "wheel"] build-backend = "setuptools.build_meta" [project] name = "azure-ai-language-conversations-authoring" authors = [ - { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] description = "Microsoft Corporation Azure Ai Language Conversations Authoring Client Library for Python" license = "MIT" @@ -24,10 +28,8 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] requires-python = ">=3.9" -keywords = [ - "azure", - "azure sdk", -] +keywords = ["azure", "azure sdk"] + dependencies = [ "isodate>=0.6.1", "azure-core>=1.35.0", @@ -35,22 +37,15 @@ dependencies = [ "azure-ai-language-conversations>=2.0.0b1", ] dynamic = [ - "version", - "readme", +"version", "readme" ] [project.urls] repository = "https://github.com/Azure/azure-sdk-for-python" -[tool.setuptools.dynamic.version] -attr = "azure.ai.language.conversations.authoring._version.VERSION" - -[tool.setuptools.dynamic.readme] -file = [ - "README.md", - "CHANGELOG.md", -] -content-type = "text/markdown" +[tool.setuptools.dynamic] +version = {attr = "azure.ai.language.conversations.authoring._version.VERSION"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ @@ -66,9 +61,7 @@ exclude = [ ] [tool.setuptools.package-data] -pytyped = [ - "py.typed", -] +pytyped = ["py.typed"] [packaging] auto_update = false 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 2571974fb43c..599663555f18 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: d8f039ebd965e40471a082c547b103dd5dc9a33b +commit: 86dbdfc0b697ef3f9ca4b752b0db35a2337977c1 repo: Azure/azure-rest-api-specs additionalDirectories: From e961c56ca1f83ee63b44e2e526971d9bddee3f70 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 15:34:19 -0800 Subject: [PATCH 06/17] renamed deployment_resources to project_resources --- .../apiview-properties.json | 20 +++---- .../authoring/aio/operations/_operations.py | 52 +++++++++---------- .../authoring/operations/_operations.py | 50 +++++++++--------- .../tsp-location.yaml | 2 +- 4 files changed, 61 insertions(+), 63 deletions(-) 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 abf7b93b13cf..e1b5551cfcbc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json @@ -121,20 +121,20 @@ "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_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_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_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_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignDeploymentResources", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_assign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.assignDeploymentResources", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.begin_unassign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignDeploymentResources", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.begin_unassign_deployment_resources": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.unassignDeploymentResources", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_assign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignDeploymentResourcesStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_assign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getAssignDeploymentResourcesStatus", - "azure.ai.language.conversations.authoring.operations.ProjectOperations.get_unassign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignDeploymentResourcesStatus", - "azure.ai.language.conversations.authoring.aio.operations.ProjectOperations.get_unassign_deployment_resources_status": "Language.ConversationsAuthoringClientCustomizations.ConversationAuthoringProjectClient.ProjectOperations.getUnassignDeploymentResourcesStatus", + "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", 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 5069c6293844..dc60faf2a28c 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 @@ -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_deployment_resources_request, + build_project_assign_project_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_deployment_resources_status_request, + build_project_get_assign_project_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_deployment_resources_status_request, + build_project_get_unassign_project_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_deployment_resources_request, + build_project_unassign_project_resources_request, build_trained_model_delete_trained_model_request, build_trained_model_evaluate_model_request, build_trained_model_get_evaluation_status_request, @@ -1946,7 +1946,7 @@ 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_deployment_resources( + def list_project_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AssignedDeploymentResource"]: """Lists the Language or AIService resources assigned to the project. @@ -1977,7 +1977,7 @@ def list_deployment_resources( def prepare_request(next_link=None): if not next_link: - _request = build_project_list_deployment_resources_request( + _request = build_project_list_project_resources_request( project_name=self._config.project_name, top=top, skip=skip, @@ -2237,7 +2237,7 @@ 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_deployment_resources_initial( + async def _assign_project_resources_initial( self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2261,7 +2261,7 @@ async def _assign_deployment_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_assign_deployment_resources_request( + _request = build_project_assign_project_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -2300,7 +2300,7 @@ async def _assign_deployment_resources_initial( return deserialized # type: ignore @overload - async def begin_assign_deployment_resources( + async def begin_assign_project_resources( self, body: _models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. @@ -2320,7 +2320,7 @@ async def begin_assign_deployment_resources( """ @overload - async def begin_assign_deployment_resources( + async def begin_assign_project_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. @@ -2340,7 +2340,7 @@ async def begin_assign_deployment_resources( """ @overload - async def begin_assign_deployment_resources( + async def begin_assign_project_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. @@ -2365,7 +2365,7 @@ async def begin_assign_deployment_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_deployment_resources( + async def begin_assign_project_resources( self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. @@ -2391,7 +2391,7 @@ async def begin_assign_deployment_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_deployment_resources_initial( + raw_result = await self._assign_project_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,7 +2428,7 @@ 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_deployment_resources_initial( + async def _unassign_project_resources_initial( self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2452,7 +2452,7 @@ async def _unassign_deployment_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_unassign_deployment_resources_request( + _request = build_project_unassign_project_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -2491,7 +2491,7 @@ async def _unassign_deployment_resources_initial( return deserialized # type: ignore @overload - async def begin_unassign_deployment_resources( + async def begin_unassign_project_resources( self, body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -2507,7 +2507,7 @@ async def begin_unassign_deployment_resources( """ @overload - async def begin_unassign_deployment_resources( + async def begin_unassign_project_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -2523,7 +2523,7 @@ async def begin_unassign_deployment_resources( """ @overload - async def begin_unassign_deployment_resources( + async def begin_unassign_project_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. @@ -2544,7 +2544,7 @@ async def begin_unassign_deployment_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_deployment_resources( + async def begin_unassign_project_resources( self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -2566,7 +2566,7 @@ async def begin_unassign_deployment_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_deployment_resources_initial( + raw_result = await self._unassign_project_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,9 +2604,7 @@ 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_deployment_resources_status( - self, job_id: str, **kwargs: Any - ) -> _models.DeploymentResourcesState: + async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. @@ -2629,7 +2627,7 @@ async def get_assign_deployment_resources_status( cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_assign_deployment_resources_status_request( + _request = build_project_get_assign_project_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -2673,7 +2671,7 @@ async def get_assign_deployment_resources_status( 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_deployment_resources_status( + async def get_unassign_project_resources_status( self, job_id: str, **kwargs: Any ) -> _models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. @@ -2698,7 +2696,7 @@ async def get_unassign_deployment_resources_status( cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_unassign_deployment_resources_status_request( + _request = build_project_get_unassign_project_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, 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 1ab900440bcb..a5046673971f 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 @@ -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_deployment_resources_request( # pylint: disable=name-too-long +def build_project_list_project_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_deployment_resources_request( # pylint: disable=name-too-long +def build_project_assign_project_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_deployment_resources_request( # pylint: disable=name-t return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_unassign_deployment_resources_request( # pylint: disable=name-too-long +def build_project_unassign_project_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_deployment_resources_request( # pylint: disable=name return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_get_assign_deployment_resources_status_request( # pylint: disable=name-too-long +def build_project_get_assign_project_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_deployment_resources_status_request( # pylint: dis return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_project_get_unassign_deployment_resources_status_request( # pylint: disable=name-too-long +def build_project_get_unassign_project_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 {}) @@ -3292,7 +3292,7 @@ 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_deployment_resources( + def list_project_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.AssignedDeploymentResource"]: """Lists the Language or AIService resources assigned to the project. @@ -3323,7 +3323,7 @@ def list_deployment_resources( def prepare_request(next_link=None): if not next_link: - _request = build_project_list_deployment_resources_request( + _request = build_project_list_project_resources_request( project_name=self._config.project_name, top=top, skip=skip, @@ -3583,7 +3583,7 @@ 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_deployment_resources_initial( + def _assign_project_resources_initial( self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3607,7 +3607,7 @@ def _assign_deployment_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_assign_deployment_resources_request( + _request = build_project_assign_project_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -3646,7 +3646,7 @@ def _assign_deployment_resources_initial( return deserialized # type: ignore @overload - def begin_assign_deployment_resources( + def begin_assign_project_resources( self, body: _models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. @@ -3666,7 +3666,7 @@ def begin_assign_deployment_resources( """ @overload - def begin_assign_deployment_resources( + def begin_assign_project_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. @@ -3686,7 +3686,7 @@ def begin_assign_deployment_resources( """ @overload - def begin_assign_deployment_resources( + def begin_assign_project_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. @@ -3711,7 +3711,7 @@ def begin_assign_deployment_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_deployment_resources( + def begin_assign_project_resources( self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Assign new Language or AIService Azure resources to a project to allowing deployment to them. @@ -3737,7 +3737,7 @@ def begin_assign_deployment_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_deployment_resources_initial( + raw_result = self._assign_project_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,7 +3773,7 @@ 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_deployment_resources_initial( + def _unassign_project_resources_initial( self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3797,7 +3797,7 @@ def _unassign_deployment_resources_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_unassign_deployment_resources_request( + _request = build_project_unassign_project_resources_request( project_name=self._config.project_name, content_type=content_type, api_version=self._config.api_version, @@ -3836,7 +3836,7 @@ def _unassign_deployment_resources_initial( return deserialized # type: ignore @overload - def begin_unassign_deployment_resources( + def begin_unassign_project_resources( self, body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -3852,7 +3852,7 @@ def begin_unassign_deployment_resources( """ @overload - def begin_unassign_deployment_resources( + def begin_unassign_project_resources( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -3868,7 +3868,7 @@ def begin_unassign_deployment_resources( """ @overload - def begin_unassign_deployment_resources( + def begin_unassign_project_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. @@ -3889,7 +3889,7 @@ def begin_unassign_deployment_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_deployment_resources( + def begin_unassign_project_resources( self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Unassign resources from a project. This disallows deployment to these resources. @@ -3911,7 +3911,7 @@ def begin_unassign_deployment_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_deployment_resources_initial( + raw_result = self._unassign_project_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,7 +3948,7 @@ 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_deployment_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: + def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. @@ -3971,7 +3971,7 @@ def get_assign_deployment_resources_status(self, job_id: str, **kwargs: Any) -> cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_assign_deployment_resources_status_request( + _request = build_project_get_assign_project_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, @@ -4015,7 +4015,7 @@ def get_assign_deployment_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"], ) - def get_unassign_deployment_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: + def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.DeploymentResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. @@ -4038,7 +4038,7 @@ def get_unassign_deployment_resources_status(self, job_id: str, **kwargs: Any) - cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) - _request = build_project_get_unassign_deployment_resources_status_request( + _request = build_project_get_unassign_project_resources_status_request( job_id=job_id, project_name=self._config.project_name, api_version=self._config.api_version, 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 599663555f18..599ad0099798 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: 86dbdfc0b697ef3f9ca4b752b0db35a2337977c1 +commit: f3deaa9de6e54581b74616193a6434aa05e4119b repo: Azure/azure-rest-api-specs additionalDirectories: From 4b61fd2bfc772229e315d73ea8dca74b42dd4d4d Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 15:44:39 -0800 Subject: [PATCH 07/17] update feature names in samples --- .../samples/async/sample_assign_deployment_resources_async.py | 2 +- .../samples/async/sample_unassign_deployment_resources_async.py | 2 +- .../samples/sample_assign_deployment_resources.py | 2 +- .../samples/sample_unassign_deployment_resources.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py index c1b89349bd1e..aa5dac3a3bd3 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py @@ -64,7 +64,7 @@ async def sample_assign_deployment_resources_async(): details = AssignDeploymentResourcesDetails(metadata=[resource]) # start assign (async long-running operation) - poller = await project_client.project.begin_assign_deployment_resources(body=details) + poller = await project_client.project.begin_assign_project_resources(body=details) try: await poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py index abc1a95127e7..6afcfec7913f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -53,7 +53,7 @@ async def sample_unassign_deployment_resources_async(): details = UnassignDeploymentResourcesDetails(assigned_resource_ids=[resource_id]) # start unassign (async long-running operation) - poller = await project_client.project.begin_unassign_deployment_resources(body=details) + poller = await project_client.project.begin_unassign_project_resources(body=details) try: await poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py index 7c2d936157c0..d5594b2f583e 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py @@ -64,7 +64,7 @@ def sample_assign_deployment_resources(): details = AssignDeploymentResourcesDetails(metadata=[resource]) # start assign (long-running operation) - poller = project_client.project.begin_assign_deployment_resources(body=details) + poller = project_client.project.begin_assign_project_resources(body=details) try: poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py index 59c39cd0b552..c16c940d411f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py @@ -55,7 +55,7 @@ def sample_unassign_deployment_resources(): details = UnassignDeploymentResourcesDetails(assigned_resource_ids=assigned_resource_ids) # start unassign (long-running operation) - poller = project_client.project.begin_unassign_deployment_resources(body=details) + poller = project_client.project.begin_unassign_project_resources(body=details) try: poller.result() From 4b993bfbb447b1a9a309d05b0c62fbd92a52e440 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 10 Nov 2025 16:49:32 -0800 Subject: [PATCH 08/17] updated assign_deployment_resources to assign_project_resources --- .../samples/README.md | 12 +++---- ... sample_assign_project_resources_async.py} | 12 +++---- ...ple_unassign_deployment_resources_async.py | 12 +++---- ....py => sample_assign_project_resources.py} | 12 +++---- .../sample_unassign_deployment_resources.py | 12 +++---- .../tests/test_create_project.py | 2 +- .../tests/test_create_project_async.py | 2 +- .../tests/test_list_project_resources.py | 36 +++++++++++++++++++ 8 files changed, 68 insertions(+), 32 deletions(-) rename sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/{sample_assign_deployment_resources_async.py => sample_assign_project_resources_async.py} (88%) rename sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/{sample_assign_deployment_resources.py => sample_assign_project_resources.py} (89%) create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md index 66fd592dabe7..7b4ca5a2ffdd 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md @@ -21,7 +21,7 @@ These sample programs show common scenarios for the Conversation Authoring clien | **File Name** | **Description** | |-|-| -| [sample_assign_deployment_resources.py][sample_assign_deployment_resources] and [sample_assign_deployment_resources_async.py][sample_assign_deployment_resources_async] | Assign deployment resources to a project. | +| [sample_assign_project_resources.py][sample_assign_project_resources] and [sample_assign_project_resources_async.py][sample_assign_project_resources_async] | Assign deployment resources to a project. | | [sample_cancel_training_job.py][sample_cancel_training_job] and [sample_cancel_training_job_async.py][sample_cancel_training_job_async] | Cancel an ongoing training job. | | [sample_create_project.py][sample_create_project] and [sample_create_project_async.py][sample_create_project_async] | Create a new conversation project. | | [sample_delete_deployment.py][sample_delete_deployment] and [sample_delete_deployment_async.py][sample_delete_deployment_async] | Delete a specific deployment from a project. | @@ -37,7 +37,7 @@ These sample programs show common scenarios for the Conversation Authoring clien | [sample_load_snapshot.py][sample_load_snapshot] and [sample_load_snapshot_async.py][sample_load_snapshot_async] | Load a snapshot of a trained model. | | [sample_swap_deployments.py][sample_swap_deployments] and [sample_swap_deployments_async.py][sample_swap_deployments_async] | Swap two deployments within a project. | | [sample_train.py][sample_train] and [sample_train_async.py][sample_train_async] | Train a model within a project. | -| [sample_unassign_deployment_resources.py][sample_unassign_deployment_resources] and [sample_unassign_deployment_resources_async.py][sample_unassign_deployment_resources_async] | Unassign deployment resources from a project. | +| [sample_unassign_project_resources.py][sample_unassign_project_resources] and [sample_unassign_project_resources_async.py][sample_unassign_project_resources_async] | Unassign deployment resources from a project. | --- @@ -79,8 +79,8 @@ Check out the [API reference documentation][api_reference_authoring] to explore [sample_authentication]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_authentication.py [sample_authentication_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_authentication_async.py -[sample_assign_deployment_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py -[sample_assign_deployment_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py +[sample_assign_project_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py +[sample_assign_project_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py [sample_cancel_training_job]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_cancel_training_job.py [sample_cancel_training_job_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py @@ -127,7 +127,7 @@ Check out the [API reference documentation][api_reference_authoring] to explore [sample_train]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_train.py [sample_train_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_train_async.py -[sample_unassign_deployment_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py -[sample_unassign_deployment_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py +[sample_unassign_project_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_project_resources.py +[sample_unassign_project_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_project_resources_async.py [versioning_story_readme]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring#install-the-package \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py similarity index 88% rename from sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py rename to sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py index aa5dac3a3bd3..4171ee4c3cee 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py @@ -5,11 +5,11 @@ # ------------------------------------ """ -FILE: sample_assign_deployment_resources_async.py +FILE: sample_assign_project_resources_async.py DESCRIPTION: This sample demonstrates how to assign deployment resources to a Conversation Authoring project (async). USAGE: - python sample_assign_deployment_resources_async.py + python sample_assign_project_resources_async.py REQUIRED ENV VARS (for AAD / DefaultAzureCredential): AZURE_CONVERSATIONS_AUTHORING_ENDPOINT @@ -29,7 +29,7 @@ RESOURCE_REGION # defaults to "" """ -# [START conversation_authoring_assign_deployment_resources_async] +# [START conversation_authoring_assign_project_resources_async] import os import asyncio from azure.identity import DefaultAzureCredential @@ -41,7 +41,7 @@ ) -async def sample_assign_deployment_resources_async(): +async def sample_assign_project_resources_async(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] @@ -76,11 +76,11 @@ async def sample_assign_deployment_resources_async(): print(e.error) -# [END conversation_authoring_assign_deployment_resources_async] +# [END conversation_authoring_assign_project_resources_async] async def main(): - await sample_assign_deployment_resources_async() + await sample_assign_project_resources_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py index 6afcfec7913f..44bceb19fd8b 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -5,11 +5,11 @@ # ------------------------------------ """ -FILE: sample_unassign_deployment_resources_async.py +FILE: sample_unassign_project_resources_async.py DESCRIPTION: This sample demonstrates how to unassign deployment resources from a Conversation Authoring project (async). USAGE: - python sample_unassign_deployment_resources_async.py + python sample_unassign_project_resources_async.py REQUIRED ENV VARS (for AAD / DefaultAzureCredential): AZURE_CONVERSATIONS_AUTHORING_ENDPOINT @@ -27,7 +27,7 @@ RESOURCE_ID # defaults to "" """ -# [START conversation_authoring_unassign_deployment_resources_async] +# [START conversation_authoring_unassign_project_resources_async] import os import asyncio from azure.identity import DefaultAzureCredential @@ -38,7 +38,7 @@ ) -async def sample_unassign_deployment_resources_async(): +async def sample_unassign_project_resources_async(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -65,11 +65,11 @@ async def sample_unassign_deployment_resources_async(): print(e.error) -# [END conversation_authoring_unassign_deployment_resources_async] +# [END conversation_authoring_unassign_project_resources_async] async def main(): - await sample_unassign_deployment_resources_async() + await sample_unassign_project_resources_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py similarity index 89% rename from sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py rename to sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py index d5594b2f583e..29dd13f395f3 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py @@ -5,12 +5,12 @@ # ------------------------------------ """ -FILE: sample_assign_deployment_resources.py +FILE: sample_assign_project_resources.py DESCRIPTION: This sample demonstrates how to assign deployment resources to a Conversation Authoring project. USAGE: - python sample_assign_deployment_resources.py + python sample_assign_project_resources.py REQUIRED ENV VARS (for AAD / DefaultAzureCredential): AZURE_CONVERSATIONS_AUTHORING_ENDPOINT @@ -30,7 +30,7 @@ RESOURCE_REGION # defaults to "" """ -# [START conversation_authoring_assign_deployment_resources] +# [START conversation_authoring_assign_project_resources] import os from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError @@ -41,7 +41,7 @@ ) -def sample_assign_deployment_resources(): +def sample_assign_project_resources(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] @@ -76,11 +76,11 @@ def sample_assign_deployment_resources(): print(e.error) -# [END conversation_authoring_assign_deployment_resources] +# [END conversation_authoring_assign_project_resources] def main(): - sample_assign_deployment_resources() + sample_assign_project_resources() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py index c16c940d411f..d4e6cd67c6a9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py @@ -5,13 +5,13 @@ # ------------------------------------ """ -FILE: sample_unassign_deployment_resources.py +FILE: sample_unassign_project_resources.py DESCRIPTION: This sample demonstrates how to unassign deployment resources from a Conversation Authoring project. USAGE: - python sample_unassign_deployment_resources.py + python sample_unassign_project_resources.py REQUIRED ENV VARS (for AAD / DefaultAzureCredential): AZURE_CONVERSATIONS_AUTHORING_ENDPOINT @@ -29,7 +29,7 @@ RESOURCE_ID # defaults to "" """ -# [START conversation_authoring_unassign_deployment_resources] +# [START conversation_authoring_unassign_project_resources] import os from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError @@ -39,7 +39,7 @@ ) -def sample_unassign_deployment_resources(): +def sample_unassign_project_resources(): # settings endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -67,11 +67,11 @@ def sample_unassign_deployment_resources(): print(e.error) -# [END conversation_authoring_unassign_deployment_resources] +# [END conversation_authoring_unassign_project_resources] def main(): - sample_unassign_deployment_resources() + sample_unassign_project_resources() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project.py index 187642ad85f8..d96a84e574f3 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project.py @@ -35,7 +35,7 @@ class TestConversationsCase(TestConversations): @recorded_by_proxy def test_create_project(self, authoring_endpoint, authoring_key): authoring_client = self.create_client(authoring_endpoint, authoring_key) - project_name = "MyPythonProject0820" + project_name = "MyPythonProject1110" # Create the project body body = CreateProjectOptions( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project_async.py index 82ba0a92d18a..60fbce0ffead 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_create_project_async.py @@ -35,7 +35,7 @@ class TestConversationsCaseAsync(TestConversations): @pytest.mark.asyncio async def test_create_project_async(self, authoring_endpoint, authoring_key): client = await self.create_client(authoring_endpoint, authoring_key) - project_name = "MyPythonProject0820Async" + project_name = "MyPythonProject1110Async" # Create the project body body = CreateProjectOptions( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py new file mode 100644 index 000000000000..5c98303e7717 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py @@ -0,0 +1,36 @@ +# pylint: disable=line-too-long,useless-suppression +import functools +from importlib import resources + +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy +from azure.core.credentials import AzureKeyCredential +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import AssignedDeploymentResource + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + + +class TestConversations(AzureRecordedTestCase): + def create_client(self, endpoint, key): + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + + +class TestConversationsDeployProjectSync(TestConversations): + @ConversationsPreparer() + @recorded_by_proxy + def test_list_project_resources(self, authoring_endpoint, authoring_key): + # Arrange + client = self.create_client(authoring_endpoint, authoring_key) + project_name = "EmailApp" + project_client = client.get_project_client(project_name) + + resources = list(project_client.project.list_project_resources()) + + for resource in resources: + assert resource.resource_id + assert resource.region From 68640e6daa8e0149db3652a4066e59f1c5b5b781 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Thu, 13 Nov 2025 11:40:23 -0800 Subject: [PATCH 09/17] updated all tests and samples --- .../apiview-properties.json | 8 +- .../authoring/aio/operations/_operations.py | 84 ++-- .../authoring/aio/operations/_patch.py | 11 +- .../aio/operations/_project_op_patch.py | 112 ++++++ .../authoring/models/__init__.py | 16 +- .../conversations/authoring/models/_models.py | 310 +++++++-------- .../conversations/authoring/models/_patch.py | 362 +++++++++++++++++- .../authoring/operations/_operations.py | 82 ++-- .../authoring/operations/_patch.py | 11 +- .../authoring/operations/_project_op_patch.py | 120 ++++++ .../sample_assign_project_resources_async.py | 24 +- .../async/sample_cancel_training_job_async.py | 2 +- .../async/sample_create_project_async.py | 2 +- .../async/sample_delete_deployment_async.py | 2 +- ..._delete_deployment_from_resources_async.py | 82 ++++ ...t_assign_project_resources_status_async.py | 73 ++++ .../async/sample_get_deployment_async.py | 2 +- ...ment_delete_from_resources_status_async.py | 76 ++++ .../samples/async/sample_get_project_async.py | 2 +- ...unassign_project_resources_status_async.py | 74 ++++ ...ist_assigned_resource_deployments_async.py | 70 ++++ .../sample_list_project_resources_async.py | 70 ++++ ...ample_unassign_project_resources_async.py} | 20 +- .../sample_assign_project_resources.py | 22 +- ...sample_delete_deployment_from_resources.py | 80 ++++ ...ple_get_assign_project_resources_status.py | 71 ++++ ...deployment_delete_from_resources_status.py | 74 ++++ ...e_get_unassign_project_resources_status.py | 72 ++++ ...mple_list_assigned_resource_deployments.py | 66 ++++ .../samples/sample_list_project_resources.py | 68 ++++ ...y => sample_unassign_project_resources.py} | 19 +- .../tests/test_cancel_training_job.py | 2 +- .../tests/test_cancel_training_job_async.py | 2 +- .../test_delete_deployment_from_resources.py | 53 +++ ..._delete_deployment_from_resources_async.py | 54 +++ .../tests/test_import_project.py | 2 +- .../tests/test_import_project_async.py | 2 +- ...test_list_assigned_resource_deployments.py | 45 +++ ...ist_assigned_resource_deployments_async.py | 47 +++ .../tests/test_list_project_resources.py | 17 +- .../test_list_project_resources_async.py | 39 ++ .../tsp-location.yaml | 2 +- 42 files changed, 2019 insertions(+), 333 deletions(-) create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_assigned_resource_deployments_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_project_resources_async.py rename sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/{sample_unassign_deployment_resources_async.py => sample_unassign_project_resources_async.py} (78%) create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_assigned_resource_deployments.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_project_resources.py rename sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/{sample_unassign_deployment_resources.py => sample_unassign_project_resources.py} (77%) create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments_async.py create mode 100644 sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources_async.py 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 e1b5551cfcbc..18f8563ccea2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/apiview-properties.json @@ -1,10 +1,10 @@ { "CrossLanguagePackageId": "Language.Conversations.Authoring", "CrossLanguageDefinitionId": { - "azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourceAssignments", - "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", @@ -19,10 +19,8 @@ "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.DeleteDeploymentDetails": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectAzureResourceIds", "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.DeploymentResourcesState": "Language.Conversations.Authoring.AnalyzeConversationAuthoringProjectResourcesJobState", "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", @@ -60,6 +58,8 @@ "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", 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 dc60faf2a28c..c831d56221f9 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 @@ -1400,7 +1400,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.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1466,7 +1466,7 @@ async def _delete_deployment_from_resources_initial( # pylint: disable=name-too async def begin_delete_deployment_from_resources( self, deployment_name: str, - body: _models.DeleteDeploymentDetails, + body: _models.ProjectResourceIds, *, content_type: str = "application/json", **kwargs: Any @@ -1478,7 +1478,7 @@ async def begin_delete_deployment_from_resources( :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.DeleteDeploymentDetails + :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 @@ -1534,7 +1534,7 @@ async def begin_delete_deployment_from_resources( 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.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -1542,9 +1542,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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON - or IO[bytes] + 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] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1948,23 +1948,23 @@ async def get_next(next_link=None): ) def list_project_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AssignedDeploymentResource"]: + ) -> AsyncItemPaged["_models.AssignedProjectResource"]: """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 AssignedDeploymentResource + :return: An iterator like instance of AssignedProjectResource :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedProjectResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2017,7 +2017,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.AssignedDeploymentResource], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedProjectResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2238,7 +2238,7 @@ async def get_next(next_link=None): api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) async def _assign_project_resources_initial( - self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2301,7 +2301,7 @@ async def _assign_project_resources_initial( @overload async def begin_assign_project_resources( - self, body: _models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any + 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 @@ -2310,7 +2310,7 @@ async def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails + :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 @@ -2366,7 +2366,7 @@ async def begin_assign_project_resources( api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) async def begin_assign_project_resources( - self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignProjectResourcesDetails, 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,9 +2375,9 @@ async def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Is one of the following types: - AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails - or JSON or IO[bytes] + AssignProjectResourcesDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2429,7 +2429,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 _unassign_project_resources_initial( - self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2492,12 +2492,12 @@ async def _unassign_project_resources_initial( @overload async def begin_unassign_project_resources( - self, body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any + 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.DeleteDeploymentDetails + :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 @@ -2545,14 +2545,14 @@ async def begin_unassign_project_resources( api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) async def begin_unassign_project_resources( - self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ProjectResourceIds, 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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON - or IO[bytes] + the following types: ProjectResourceIds, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or + IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2604,14 +2604,13 @@ 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.DeploymentResourcesState: + async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState + :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2625,7 +2624,7 @@ 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.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_project_resources_status_request( job_id=job_id, @@ -2658,7 +2657,7 @@ async def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) + deserialized = _deserialize(_models.ProjectResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2671,16 +2670,13 @@ 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.DeploymentResourcesState: + async def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState + :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2694,7 +2690,7 @@ async def get_unassign_project_resources_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_project_resources_status_request( job_id=job_id, @@ -2727,7 +2723,7 @@ async def get_unassign_project_resources_status( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) + deserialized = _deserialize(_models.ProjectResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3146,7 +3142,7 @@ async def _import_method_initial( return deserialized # type: ignore @overload - async def begin_import_method( + async def begin_import( self, body: _models.ExportedProject, *, @@ -3172,7 +3168,7 @@ async def begin_import_method( """ @overload - async def begin_import_method( + async def begin_import( self, body: JSON, *, @@ -3198,7 +3194,7 @@ async def begin_import_method( """ @overload - async def begin_import_method( + async def begin_import( self, body: IO[bytes], *, @@ -3224,7 +3220,7 @@ async def begin_import_method( """ @distributed_trace_async - async def begin_import_method( + async def begin_import( self, body: Union[_models.ExportedProject, JSON, IO[bytes]], *, 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 87676c65a8f0..de420e5960c8 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,20 @@ +# 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 """ - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - +from ._project_op_patch import ProjectOperations 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"] \ No newline at end of file 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 new file mode 100644 index 000000000000..446840525f87 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_project_op_patch.py @@ -0,0 +1,112 @@ +# 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 IO, Any, Callable, Dict, Optional, TypeVar, Union, cast, overload + +from azure.core.async_paging import AsyncItemPaged +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.""" + + def __init__(self, *args, **kwargs: Any): + super().__init__(*args, **kwargs) + + @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] + ) \ No newline at end of file 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 8e8ad79d4dd7..cf78e10fa6c9 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,10 +14,10 @@ from ._models import ( # type: ignore - AssignDeploymentResourcesDetails, - AssignedDeploymentResource, + AssignProjectResourcesDetails, AssignedProjectDeploymentMetadata, AssignedProjectDeploymentsMetadata, + AssignedProjectResource, ConfusionMatrixCell, ConfusionMatrixRow, ConversationExportedAssociatedEntityLabel, @@ -31,10 +31,8 @@ CreateProjectOptions, DataGenerationConnectionInfo, DataGenerationSettings, - DeleteDeploymentDetails, DeploymentDeleteFromResourcesState, DeploymentResource, - DeploymentResourcesState, DeploymentState, EntitiesEvaluationSummary, EntityEvaluationSummary, @@ -73,6 +71,8 @@ ProjectDeletionState, ProjectDeployment, ProjectDetails, + ProjectResourceIds, + ProjectResourcesState, ProjectSettings, ProjectTrainedModel, ResourceMetadata, @@ -107,10 +107,10 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AssignDeploymentResourcesDetails", - "AssignedDeploymentResource", + "AssignProjectResourcesDetails", "AssignedProjectDeploymentMetadata", "AssignedProjectDeploymentsMetadata", + "AssignedProjectResource", "ConfusionMatrixCell", "ConfusionMatrixRow", "ConversationExportedAssociatedEntityLabel", @@ -124,10 +124,8 @@ "CreateProjectOptions", "DataGenerationConnectionInfo", "DataGenerationSettings", - "DeleteDeploymentDetails", "DeploymentDeleteFromResourcesState", "DeploymentResource", - "DeploymentResourcesState", "DeploymentState", "EntitiesEvaluationSummary", "EntityEvaluationSummary", @@ -166,6 +164,8 @@ "ProjectDeletionState", "ProjectDeployment", "ProjectDetails", + "ProjectResourceIds", + "ProjectResourcesState", "ProjectSettings", "ProjectTrainedModel", "ResourceMetadata", 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 8d8ed203f559..18177eb1ff69 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,23 +20,35 @@ from .. import models as _models -class AssignDeploymentResourcesDetails(_Model): - """Represents the payload for assigning Azure resources to a project. +class AssignedProjectDeploymentMetadata(_Model): + """Represents the metadata for an assigned deployment. - :ivar metadata: Represents the metadata for the project resources to be assigned. Required. - :vartype metadata: list[~azure.ai.language.conversations.authoring.models.ResourceMetadata] + :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 """ - metadata: list["_models.ResourceMetadata"] = rest_field( - name="projectResources", 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 metadata for the project resources to be assigned. Required.""" + """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, *, - metadata: list["_models.ResourceMetadata"], + deployment_name: str, + last_deployed_on: datetime.datetime, + deployment_expires_on: datetime.date, ) -> None: ... @overload @@ -50,25 +62,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignedDeploymentResource(_Model): - """Represents the assigned project resource. +class AssignedProjectDeploymentsMetadata(_Model): + """Represents the metadata for assigned deployments for a project. - :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 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] """ - 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.""" + 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.""" @overload def __init__( self, *, - region: str, + deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"], ) -> None: ... @overload @@ -82,35 +97,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignedProjectDeploymentMetadata(_Model): - """Represents the metadata for an assigned deployment. +class AssignedProjectResource(_Model): + """Represents the assigned project resource. - :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 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 """ - 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"] - ) - """Represents deployment expiration date in the runtime. 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, *, - deployment_name: str, - last_deployed_on: datetime.datetime, - deployment_expires_on: datetime.date, + region: str, ) -> None: ... @overload @@ -124,28 +129,23 @@ 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 AssignProjectResourcesDetails(_Model): + """Represents the payload for assigning Azure resources to a project. - :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 metadata: Represents the metadata for the project resources to be assigned. Required. + :vartype metadata: list[~azure.ai.language.conversations.authoring.models.ResourceMetadata] """ - 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"] + metadata: list["_models.ResourceMetadata"] = rest_field( + name="projectResources", visibility=["read", "create", "update", "delete", "query"] ) - """Represents the resource region. Required.""" + """Represents the metadata for the project resources to be assigned. Required.""" @overload def __init__( self, *, - deployments_metadata: list["_models.AssignedProjectDeploymentMetadata"], + metadata: list["_models.ResourceMetadata"], ) -> None: ... @overload @@ -820,38 +820,6 @@ 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 - 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 DeploymentDeleteFromResourcesState(_Model): """Represents the state of an existing delete deployment from specific resources job. @@ -960,73 +928,6 @@ 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 - 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 DeploymentState(_Model): """Represents the state of a deployment job. @@ -2784,7 +2685,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.AssignedDeploymentResource] + list[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] """ deployment_name: str = rest_field(name="deploymentName", visibility=["read"]) @@ -2807,7 +2708,7 @@ class ProjectDeployment(_Model): name="modelTrainingConfigVersion", visibility=["read", "create", "update", "delete", "query"] ) """Represents model training config version. Required.""" - assigned_resources: list["_models.AssignedDeploymentResource"] = rest_field( + assigned_resources: list["_models.AssignedProjectResource"] = rest_field( name="assignedResources", visibility=["read", "create", "update", "delete", "query"] ) """Represents the metadata of the assigned Azure resources. Required.""" @@ -2821,7 +2722,7 @@ def __init__( last_deployed_on: datetime.datetime, deployment_expired_on: datetime.date, model_training_config_version: str, - assigned_resources: list["_models.AssignedDeploymentResource"], + assigned_resources: list["_models.AssignedProjectResource"], ) -> None: ... @overload @@ -2928,6 +2829,105 @@ 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. 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 87676c65a8f0..0eb33dfa8905 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,21 +1,377 @@ +# 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) -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + # ---- 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 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", +] \ No newline at end of file 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 a5046673971f..a628bf3b1964 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 @@ -2747,7 +2747,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.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2813,7 +2813,7 @@ def _delete_deployment_from_resources_initial( # pylint: disable=name-too-long def begin_delete_deployment_from_resources( self, deployment_name: str, - body: _models.DeleteDeploymentDetails, + body: _models.ProjectResourceIds, *, content_type: str = "application/json", **kwargs: Any @@ -2825,7 +2825,7 @@ def begin_delete_deployment_from_resources( :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.DeleteDeploymentDetails + :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 @@ -2881,7 +2881,7 @@ def begin_delete_deployment_from_resources( 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.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, deployment_name: str, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Deletes a deployment from the specified project-assigned resources. @@ -2889,9 +2889,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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON - or IO[bytes] + 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] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3294,23 +3294,23 @@ def get_next(next_link=None): ) def list_project_resources( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.AssignedDeploymentResource"]: + ) -> ItemPaged["_models.AssignedProjectResource"]: """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 AssignedDeploymentResource + :return: An iterator like instance of AssignedProjectResource :rtype: - ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.AssignedDeploymentResource] + ~azure.core.paging.ItemPaged[~azure.ai.language.conversations.authoring.models.AssignedProjectResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[list[_models.AssignedDeploymentResource]] = kwargs.pop("cls", None) + cls: ClsType[list[_models.AssignedProjectResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3363,7 +3363,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(list[_models.AssignedDeploymentResource], deserialized.get("value", [])) + list_of_elem = _deserialize(list[_models.AssignedProjectResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3584,7 +3584,7 @@ def get_next(next_link=None): api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def _assign_project_resources_initial( - self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignProjectResourcesDetails, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3647,7 +3647,7 @@ def _assign_project_resources_initial( @overload def begin_assign_project_resources( - self, body: _models.AssignDeploymentResourcesDetails, *, content_type: str = "application/json", **kwargs: Any + 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 @@ -3656,7 +3656,7 @@ def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails + :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 @@ -3712,7 +3712,7 @@ def begin_assign_project_resources( api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def begin_assign_project_resources( - self, body: Union[_models.AssignDeploymentResourcesDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.AssignProjectResourcesDetails, 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,9 +3721,9 @@ def begin_assign_project_resources( `_. :param body: The new project resources to be assigned. Is one of the following types: - AssignDeploymentResourcesDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.AssignDeploymentResourcesDetails - or JSON or IO[bytes] + AssignProjectResourcesDetails, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models.AssignProjectResourcesDetails or + JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3774,7 +3774,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 _unassign_project_resources_initial( - self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ProjectResourceIds, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3837,12 +3837,12 @@ def _unassign_project_resources_initial( @overload def begin_unassign_project_resources( - self, body: _models.DeleteDeploymentDetails, *, content_type: str = "application/json", **kwargs: Any + 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.DeleteDeploymentDetails + :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 @@ -3890,14 +3890,14 @@ def begin_unassign_project_resources( api_versions_list=["2025-11-01", "2025-05-15-preview", "2025-11-15-preview"], ) def begin_unassign_project_resources( - self, body: Union[_models.DeleteDeploymentDetails, JSON, IO[bytes]], **kwargs: Any + self, body: Union[_models.ProjectResourceIds, 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: DeleteDeploymentDetails, JSON, IO[bytes] Required. - :type body: ~azure.ai.language.conversations.authoring.models.DeleteDeploymentDetails or JSON - or IO[bytes] + the following types: ProjectResourceIds, JSON, IO[bytes] Required. + :type body: ~azure.ai.language.conversations.authoring.models.ProjectResourceIds or JSON or + IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3948,14 +3948,13 @@ 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.DeploymentResourcesState: + def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: """Gets the status of an existing assign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState + :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3969,7 +3968,7 @@ 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.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) _request = build_project_get_assign_project_resources_status_request( job_id=job_id, @@ -4002,7 +4001,7 @@ def get_assign_project_resources_status(self, job_id: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) + deserialized = _deserialize(_models.ProjectResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4015,14 +4014,13 @@ 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.DeploymentResourcesState: + def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _models.ProjectResourcesState: """Gets the status of an existing unassign project resources job. :param job_id: The job ID. Required. :type job_id: str - :return: DeploymentResourcesState. The DeploymentResourcesState is compatible with - MutableMapping - :rtype: ~azure.ai.language.conversations.authoring.models.DeploymentResourcesState + :return: ProjectResourcesState. The ProjectResourcesState is compatible with MutableMapping + :rtype: ~azure.ai.language.conversations.authoring.models.ProjectResourcesState :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4036,7 +4034,7 @@ 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.DeploymentResourcesState] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectResourcesState] = kwargs.pop("cls", None) _request = build_project_get_unassign_project_resources_status_request( job_id=job_id, @@ -4069,7 +4067,7 @@ def get_unassign_project_resources_status(self, job_id: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DeploymentResourcesState, response.json()) + deserialized = _deserialize(_models.ProjectResourcesState, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4487,7 +4485,7 @@ def _import_method_initial( return deserialized # type: ignore @overload - def begin_import_method( + def begin_import( self, body: _models.ExportedProject, *, @@ -4513,7 +4511,7 @@ def begin_import_method( """ @overload - def begin_import_method( + def begin_import( self, body: JSON, *, @@ -4539,7 +4537,7 @@ def begin_import_method( """ @overload - def begin_import_method( + def begin_import( self, body: IO[bytes], *, @@ -4565,7 +4563,7 @@ def begin_import_method( """ @distributed_trace - def begin_import_method( + def begin_import( self, body: Union[_models.ExportedProject, JSON, IO[bytes]], *, 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 87676c65a8f0..de420e5960c8 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,20 @@ +# 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 """ - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - +from ._project_op_patch import ProjectOperations 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"] \ No newline at end of file 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 new file mode 100644 index 000000000000..f2dbc299b583 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/operations/_project_op_patch.py @@ -0,0 +1,120 @@ +# 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 IO, 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): + """Patched ProjectOperationsOperations that auto-injects project_name.""" + + def __init__(self, *args, **kwargs: Any): + super().__init__(*args, **kwargs) + + @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 + # ) \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py index 4171ee4c3cee..f5fd9a6af9c9 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_assign_project_resources_async.py @@ -32,13 +32,10 @@ # [START conversation_authoring_assign_project_resources_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import ( - ResourceMetadata, - AssignDeploymentResourcesDetails, -) +from azure.ai.language.conversations.authoring.models import AssignProjectResourcesDetails, ResourceMetadata async def sample_assign_project_resources_async(): @@ -50,21 +47,22 @@ async def sample_assign_project_resources_async(): resource_domain = os.environ.get("RESOURCE_DOMAIN", "") resource_region = os.environ.get("RESOURCE_REGION", "") - # async client (AAD) credential = DefaultAzureCredential() async with ConversationAuthoringClient(endpoint, credential=credential) as client: project_client = client.get_project_client(project_name) - # build request body - resource = ResourceMetadata( - azure_resource_id=resource_id, - custom_domain=resource_domain, - region=resource_region, + body = AssignProjectResourcesDetails( + metadata=[ + ResourceMetadata( + azure_resource_id=resource_id, + custom_domain=resource_domain, + region=resource_region, + ) + ] ) - details = AssignDeploymentResourcesDetails(metadata=[resource]) # start assign (async long-running operation) - poller = await project_client.project.begin_assign_project_resources(body=details) + poller = await project_client.project.begin_assign_project_resources(body=body) try: await poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py index d481a65812d9..8b30261b13a6 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_cancel_training_job_async.py @@ -30,7 +30,7 @@ # [START conversation_authoring_cancel_training_job_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py index ef752d3844a2..8f2fe39606d0 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_create_project_async.py @@ -29,7 +29,7 @@ # [START conversation_authoring_create_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient from azure.ai.language.conversations.authoring.models import ( CreateProjectOptions, diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py index 1b86815373b6..46d1e91a5092 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_async.py @@ -30,7 +30,7 @@ # [START conversation_authoring_delete_deployment_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py new file mode 100644 index 000000000000..4ea5547629af --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_delete_deployment_from_resources_async.py +DESCRIPTION: + This sample demonstrates how to delete a deployment from specific resources in a Conversation Authoring project (async). + +USAGE: + python sample_delete_deployment_from_resources_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" + RESOURCE_ID # defaults to "" +""" + +# [START conversation_authoring_delete_deployment_from_resources_async] +import os +import asyncio +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourceIds + + +async def sample_delete_deployment_from_resources_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + + project_name = os.environ.get("PROJECT_NAME", "") + resource_id = os.environ.get("RESOURCE_ID", "") + + deployment_name = "test-deployment" + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + project_client = client.get_project_client(project_name) + + delete_body = ProjectResourceIds( + azure_resource_ids=[resource_id] + ) + + # start delete-from-resources (async long-running operation) + poller = await project_client.deployment.begin_delete_deployment_from_resources( + deployment_name=deployment_name, + body=delete_body, + ) + + try: + await poller.result() + print("Delete completed.") + print(f"done: {poller.done()}") + print(f"status: {poller.status()}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_delete_deployment_from_resources_async] + + +async def main(): + await sample_delete_deployment_from_resources_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py new file mode 100644 index 000000000000..c15941f3feef --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_assign_project_resources_status_async.py +DESCRIPTION: + This sample demonstrates how to get the status of a project resource-assignment job in a Conversation Authoring project (async). + +USAGE: + python sample_get_assign_project_resources_status_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_assign_project_resources_status_async] +import os +import asyncio +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourcesState + + +async def sample_get_assign_project_resources_status_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # Example job ID (replace with real one returned by assign operation) + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = await project_client.project.get_assign_project_resources_status(job_id) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_assign_project_resources_status_async] + + +async def main(): + await sample_get_assign_project_resources_status_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py index add2ef1cfdae..28122d9f342f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_async.py @@ -30,7 +30,7 @@ # [START conversation_authoring_get_deployment_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py new file mode 100644 index 000000000000..e41a9949621f --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_deployment_delete_from_resources_status_async.py +DESCRIPTION: + This sample demonstrates how to get the status of a deployment deletion job from specific resources in a Conversation Authoring project (async). + +USAGE: + python sample_get_deployment_delete_from_resources_status_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_deployment_delete_from_resources_status_async] +import os +import asyncio +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import DeploymentDeleteFromResourcesState + + +async def sample_get_deployment_delete_from_resources_status_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + deployment_name = "deploysdk02" + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = await project_client.deployment.get_deployment_delete_from_resources_status( + deployment_name=deployment_name, + job_id=job_id, + ) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + print(f"Expires On: {state.expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_deployment_delete_from_resources_status_async] + + +async def main(): + await sample_get_deployment_delete_from_resources_status_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py index 5d64097e01c9..1d58ef7641f5 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_project_async.py @@ -29,7 +29,7 @@ # [START conversation_authoring_get_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py new file mode 100644 index 000000000000..2cbd82b8fbcc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_unassign_project_resources_status_async.py +DESCRIPTION: + This sample demonstrates how to get the status of a project unassign-resources job in a Conversation Authoring project (async). + +USAGE: + python sample_get_unassign_project_resources_status_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_unassign_project_resources_status_async] +import os +import asyncio +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourcesState + + +async def sample_get_unassign_project_resources_status_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # Example job ID (replace with real one returned by unassign operation) + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = await project_client.project.get_unassign_project_resources_status(job_id) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + print(f"Expires On: {state.expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_unassign_project_resources_status_async] + + +async def main(): + await sample_get_unassign_project_resources_status_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_assigned_resource_deployments_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_assigned_resource_deployments_async.py new file mode 100644 index 000000000000..eb8686ec2fb7 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_assigned_resource_deployments_async.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_list_assigned_resource_deployments_async.py +DESCRIPTION: + This sample demonstrates how to list all assigned resource deployments for Conversation Authoring projects (async). + +USAGE: + python sample_list_assigned_resource_deployments_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY +""" + +# [START conversation_authoring_list_assigned_resource_deployments_async] +import os +import asyncio +from datetime import date, datetime +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ( + AssignedProjectDeploymentsMetadata, + AssignedProjectDeploymentMetadata, +) + + +async def sample_list_assigned_resource_deployments_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + try: + paged = client.list_assigned_resource_deployments() + print("Assigned resource deployments retrieved successfully.") + + async for meta in paged: + print(f"\nProject Name: {meta.project_name}") + for d in meta.deployments_metadata: + print(f" Deployment Name: {d.deployment_name}") + print(f" Last Deployed On: {d.last_deployed_on}") + print(f" Expires On: {d.deployment_expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_list_assigned_resource_deployments_async] + + +async def main(): + await sample_list_assigned_resource_deployments_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_project_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_project_resources_async.py new file mode 100644 index 000000000000..5b65324f6ea6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_project_resources_async.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_list_project_resources_async.py +DESCRIPTION: + This sample demonstrates how to list all assigned resources for a Conversation Authoring project (async). + +USAGE: + python sample_list_project_resources_async.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_list_project_resources_async] +import os +import asyncio +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import AssignedProjectResource + + +async def sample_list_project_resources_async(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + credential = DefaultAzureCredential() + async with ConversationAuthoringClient(endpoint, credential=credential) as client: + project_client = client.get_project_client(project_name) + + # list assigned project resources + try: + paged = project_client.project.list_project_resources() + print("Assigned project resources retrieved successfully.") + + async for res in paged: + print(f"\nResource ID: {res.resource_id}") + print(f"Region: {res.region}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_list_project_resources_async] + + +async def main(): + await sample_list_project_resources_async() + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_project_resources_async.py similarity index 78% rename from sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py rename to sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_project_resources_async.py index 44bceb19fd8b..918f7c862db4 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_project_resources_async.py @@ -7,7 +7,8 @@ """ FILE: sample_unassign_project_resources_async.py DESCRIPTION: - This sample demonstrates how to unassign deployment resources from a Conversation Authoring project (async). + This sample demonstrates how to unassign specific Azure resources from a Conversation Authoring project (async). + USAGE: python sample_unassign_project_resources_async.py @@ -23,19 +24,17 @@ - AZURE_CONVERSATIONS_AUTHORING_KEY OPTIONAL ENV VARS: - PROJECT_NAME # defaults to "" - RESOURCE_ID # defaults to "" + PROJECT_NAME # defaults to "" + RESOURCE_ID # defaults to "" """ # [START conversation_authoring_unassign_project_resources_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import ( - UnassignDeploymentResourcesDetails, -) +from azure.ai.language.conversations.authoring.models import ProjectResourceIds async def sample_unassign_project_resources_async(): @@ -46,14 +45,13 @@ async def sample_unassign_project_resources_async(): credential = DefaultAzureCredential() async with ConversationAuthoringClient(endpoint, credential=credential) as client: - # get project-scoped client project_client = client.get_project_client(project_name) - # build request body - details = UnassignDeploymentResourcesDetails(assigned_resource_ids=[resource_id]) + # prepare request body + body = ProjectResourceIds(azure_resource_ids=[resource_id]) # start unassign (async long-running operation) - poller = await project_client.project.begin_unassign_project_resources(body=details) + poller = await project_client.project.begin_unassign_project_resources(body=body) try: await poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py index 29dd13f395f3..7cdab8cdec64 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_assign_project_resources.py @@ -35,10 +35,7 @@ from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import ( - ResourceMetadata, - AssignDeploymentResourcesDetails, -) +from azure.ai.language.conversations.authoring.models import AssignProjectResourcesDetails, ResourceMetadata def sample_assign_project_resources(): @@ -50,21 +47,22 @@ def sample_assign_project_resources(): resource_domain = os.environ.get("RESOURCE_DOMAIN", "") resource_region = os.environ.get("RESOURCE_REGION", "") - # create a client with AAD credential = DefaultAzureCredential() client = ConversationAuthoringClient(endpoint, credential=credential) project_client = client.get_project_client(project_name) - # build request body - resource = ResourceMetadata( - azure_resource_id=resource_id, - custom_domain=resource_domain, - region=resource_region, + body = AssignProjectResourcesDetails( + metadata=[ + ResourceMetadata( + azure_resource_id=resource_id, + custom_domain=resource_domain, + region=resource_region, + ) + ] ) - details = AssignDeploymentResourcesDetails(metadata=[resource]) # start assign (long-running operation) - poller = project_client.project.begin_assign_project_resources(body=details) + poller = project_client.project.begin_assign_project_resources(body=body) try: poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py new file mode 100644 index 000000000000..33a44264ddec --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_delete_deployment_from_resources.py +DESCRIPTION: + This sample demonstrates how to delete a deployment from specific resources in a Conversation Authoring project. + +USAGE: + python sample_delete_deployment_from_resources.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" + RESOURCE_ID # defaults to "" +""" + +# [START conversation_authoring_delete_deployment_from_resources] +import os +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourceIds + + +def sample_delete_deployment_from_resources(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + + project_name = os.environ.get("PROJECT_NAME", "") + resource_id = os.environ.get("RESOURCE_ID", "") + + deployment_name = "test-deployment" + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + delete_body = ProjectResourceIds( + azure_resource_ids=[resource_id] + ) + + # start delete-from-resources (long-running operation) + poller = project_client.deployment.begin_delete_deployment_from_resources( + deployment_name=deployment_name, + body=delete_body, + ) + + try: + poller.result() + print("Delete completed.") + print(f"done: {poller.done()}") + print(f"status: {poller.status()}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_delete_deployment_from_resources] + + +def main(): + sample_delete_deployment_from_resources() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py new file mode 100644 index 000000000000..b5bc0d2257fc --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_assign_project_resources_status.py +DESCRIPTION: + This sample demonstrates how to get the status of a project resource-assignment job in a Conversation Authoring project. + +USAGE: + python sample_get_assign_project_resources_status.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_assign_project_resources_status] +import os +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourcesState + + +def sample_get_assign_project_resources_status(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # Example job ID (replace with real one returned by assign operation) + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = project_client.project.get_assign_project_resources_status(job_id) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_assign_project_resources_status] + + +def main(): + sample_get_assign_project_resources_status() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py new file mode 100644 index 000000000000..bae765611707 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_deployment_delete_from_resources_status.py +DESCRIPTION: + This sample demonstrates how to get the status of a deployment deletion job from specific resources in a Conversation Authoring project. + +USAGE: + python sample_get_deployment_delete_from_resources_status.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_deployment_delete_from_resources_status] +import os +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import DeploymentDeleteFromResourcesState + + +def sample_get_deployment_delete_from_resources_status(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + deployment_name = "deploysdk02" + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = project_client.deployment.get_deployment_delete_from_resources_status( + deployment_name=deployment_name, + job_id=job_id, + ) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + print(f"Expires On: {state.expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_deployment_delete_from_resources_status] + + +def main(): + sample_get_deployment_delete_from_resources_status() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py new file mode 100644 index 000000000000..8eb5af886987 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_get_unassign_project_resources_status.py +DESCRIPTION: + This sample demonstrates how to get the status of a project unassign-resources job in a Conversation Authoring project. + +USAGE: + python sample_get_unassign_project_resources_status.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_get_unassign_project_resources_status] +import os +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourcesState + + +def sample_get_unassign_project_resources_status(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # Example job ID (replace with real one returned by unassign operation) + job_id = "00000000-0000-0000-0000-000000000000" + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # start get-status call + try: + state = project_client.project.get_unassign_project_resources_status(job_id) + print("Status retrieved successfully.") + print(f"Job ID: {state.job_id}") + print(f"Status: {state.status}") + print(f"Created On: {state.created_on}") + print(f"Last Updated On: {state.last_updated_on}") + print(f"Expires On: {state.expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_get_unassign_project_resources_status] + + +def main(): + sample_get_unassign_project_resources_status() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_assigned_resource_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_assigned_resource_deployments.py new file mode 100644 index 000000000000..b1bb9f414c69 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_assigned_resource_deployments.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_list_assigned_resource_deployments.py +DESCRIPTION: + This sample demonstrates how to list all assigned resource deployments for Conversation Authoring projects. + +USAGE: + python sample_list_assigned_resource_deployments.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY +""" + +# [START conversation_authoring_list_assigned_resource_deployments] +import os +from datetime import date, datetime +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient + + +def sample_list_assigned_resource_deployments(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + + # list assigned resource deployments + try: + paged = client.list_assigned_resource_deployments() + print("Assigned resource deployments retrieved successfully.") + + for meta in paged: + print(f"\nProject Name: {meta.project_name}") + for d in meta.deployments_metadata: + print(f" Deployment Name: {d.deployment_name}") + print(f" Last Deployed On: {d.last_deployed_on}") + print(f" Expires On: {d.deployment_expires_on}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_list_assigned_resource_deployments] + + +def main(): + sample_list_assigned_resource_deployments() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_project_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_project_resources.py new file mode 100644 index 000000000000..bec0c10550e6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_project_resources.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +FILE: sample_list_project_resources.py +DESCRIPTION: + This sample demonstrates how to list all assigned resources for a Conversation Authoring project. + +USAGE: + python sample_list_project_resources.py + +REQUIRED ENV VARS (for AAD / DefaultAzureCredential): + AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + AZURE_CLIENT_ID + AZURE_TENANT_ID + AZURE_CLIENT_SECRET + +NOTE: + If you want to use AzureKeyCredential instead, set: + - AZURE_CONVERSATIONS_AUTHORING_ENDPOINT + - AZURE_CONVERSATIONS_AUTHORING_KEY + +OPTIONAL ENV VARS: + PROJECT_NAME # defaults to "" +""" + +# [START conversation_authoring_list_project_resources] +import os +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import AssignedProjectResource + + +def sample_list_project_resources(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # list assigned project resources + try: + paged = project_client.project.list_project_resources() + print("Assigned project resources retrieved successfully.") + + for res in paged: + print(f"\nResource ID: {res.resource_id}") + print(f"Region: {res.region}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + + +# [END conversation_authoring_list_project_resources] + + +def main(): + sample_list_project_resources() + + +if __name__ == "__main__": + main() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_project_resources.py similarity index 77% rename from sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py rename to sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_project_resources.py index d4e6cd67c6a9..67c739cc03ee 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_deployment_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_project_resources.py @@ -6,9 +6,8 @@ """ FILE: sample_unassign_project_resources.py - DESCRIPTION: - This sample demonstrates how to unassign deployment resources from a Conversation Authoring project. + This sample demonstrates how to unassign specific Azure resources from a Conversation Authoring project. USAGE: python sample_unassign_project_resources.py @@ -25,8 +24,8 @@ - AZURE_CONVERSATIONS_AUTHORING_KEY OPTIONAL ENV VARS: - PROJECT_NAME # defaults to "" - RESOURCE_ID # defaults to "" + PROJECT_NAME # defaults to "" + RESOURCE_ID # defaults to "" """ # [START conversation_authoring_unassign_project_resources] @@ -34,9 +33,7 @@ from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import ( - UnassignDeploymentResourcesDetails, -) +from azure.ai.language.conversations.authoring.models import ProjectResourceIds def sample_unassign_project_resources(): @@ -45,17 +42,15 @@ def sample_unassign_project_resources(): project_name = os.environ.get("PROJECT_NAME", "") resource_id = os.environ.get("RESOURCE_ID", "") - # create a client with AAD credential = DefaultAzureCredential() client = ConversationAuthoringClient(endpoint, credential=credential) project_client = client.get_project_client(project_name) - # build request body - assigned_resource_ids = [resource_id] - details = UnassignDeploymentResourcesDetails(assigned_resource_ids=assigned_resource_ids) + # prepare request body + body = ProjectResourceIds(azure_resource_ids=[resource_id]) # start unassign (long-running operation) - poller = project_client.project.begin_unassign_project_resources(body=details) + poller = project_client.project.begin_unassign_project_resources(body=body) try: poller.result() diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py index 3e0954e58e75..76b212e75e00 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job.py @@ -27,7 +27,7 @@ def test_cancel_training_job(self, authoring_endpoint, authoring_key): client = self.create_client(authoring_endpoint, authoring_key) project_client = client.get_project_client("Test-data-labels") - job_id = "e097b8e7-5cef-491a-aba6-24a82580973e_638919360000000000" + job_id = "0f2fa6fe-c39c-48d5-a1e1-1e549a1c2299_638985888000000000" poller = project_client.project.begin_cancel_training_job( job_id=job_id, diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py index 419fa1a1463e..e6b1e912bfcc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_cancel_training_job_async.py @@ -29,7 +29,7 @@ async def test_cancel_training_job_async(self, authoring_endpoint, authoring_key client = await self.create_client(authoring_endpoint, authoring_key) try: project_name = "Test-data-labels" - job_id = "f0f1760a-f9b9-4a7c-924d-57892aa75ebd_638916768000000000" + job_id = "122b7341-afaa-4bea-af63-f6c7e0539fcb_638985888000000000" project_client = client.get_project_client(project_name) poller = await project_client.project.begin_cancel_training_job( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources.py new file mode 100644 index 000000000000..635eb0014ef0 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources.py @@ -0,0 +1,53 @@ +# pylint: disable=line-too-long,useless-suppression +import functools + +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy +from azure.core.credentials import AzureKeyCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourceIds + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + + +class TestConversations(AzureRecordedTestCase): + def create_client(self, endpoint, key): + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + + +class TestConversationsDeleteDeploymentSync(TestConversations): + @ConversationsPreparer() + @recorded_by_proxy + def test_delete_deployment_from_resources(self, authoring_endpoint, authoring_key): + # Arrange + client = self.create_client(authoring_endpoint, authoring_key) + project_name = "EmailApp" + deployment_name = "deploysdk2" + project_client = client.get_project_client(project_name) + + # Create request body with the resource IDs to unassign/delete from + delete_body = ProjectResourceIds( + azure_resource_ids=[ + "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-02" + ] + ) + + # Act: begin delete and wait for completion + poller = project_client.deployment.begin_delete_deployment_from_resources( + deployment_name=deployment_name, body=delete_body + ) + + try: + poller.result() + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + raise + + # Assert completion + print(f"Delete completed. done={poller.done()} status={poller.status()}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py new file mode 100644 index 000000000000..185f429b2ee6 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py @@ -0,0 +1,54 @@ +# pylint: disable=line-too-long,useless-suppression +import functools +import pytest + +from devtools_testutils import EnvironmentVariableLoader, AzureRecordedTestCase +from devtools_testutils.aio import recorded_by_proxy_async +from azure.core.credentials import AzureKeyCredential +from azure.core.exceptions import HttpResponseError +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ProjectResourceIds + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + +class TestConversationsAsync(AzureRecordedTestCase): + async def create_client(self, endpoint: str, key: str) -> ConversationAuthoringClient: + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + +class TestConversationsDeleteDeploymentFromResourcesAsync(TestConversationsAsync): + @ConversationsPreparer() + @recorded_by_proxy_async + @pytest.mark.asyncio + async def test_delete_deployment_from_resources_async(self, authoring_endpoint, authoring_key): + client = await self.create_client(authoring_endpoint, authoring_key) + async with client: + project_name = "EmailApp" + deployment_name = "deploysdk2" + project_client = client.get_project_client(project_name) + + delete_body = ProjectResourceIds( + azure_resource_ids=[ + "/subscriptions/b72743ec-8bb3-453f-83ad-a53e8a50712e/resourceGroups/language-sdk-rg/providers/Microsoft.CognitiveServices/accounts/sdk-test-02" + ] + ) + + poller = await project_client.deployment.begin_delete_deployment_from_resources( + deployment_name=deployment_name, + body=delete_body, + ) + + try: + await poller.result() + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) + raise + + # Assert completion + assert poller.done() + print(f"Delete completed. done={poller.done()} status={poller.status()}") diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project.py index c76d52f2069d..f2b3c75e7f7a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project.py @@ -42,7 +42,7 @@ class TestConversationsImportCase(TestConversations): @recorded_by_proxy def test_import_project(self, authoring_endpoint, authoring_key): authoring_client = self.create_client(authoring_endpoint, authoring_key) - project_name = "PythonImportProject0820" + project_name = "PythonImportProject1113" project_client = authoring_client.get_project_client(project_name) # ----- Build assets using objects ----- diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project_async.py index bef6bd0d4ab7..851c13120f2f 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_import_project_async.py @@ -40,7 +40,7 @@ class TestConversationsImportCaseAsync(TestConversations): async def test_import_project_async(self, authoring_endpoint, authoring_key): client = await self.create_client(authoring_endpoint, authoring_key) async with client: - project_name = "PythonImportProject0828" + project_name = "PythonImportProject1113" project_client = client.get_project_client(project_name) # ----- Build assets using objects ----- diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments.py new file mode 100644 index 000000000000..fd14ba858011 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +from datetime import date, datetime +import functools +from importlib import resources + +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy +from azure.core.credentials import AzureKeyCredential +from azure.ai.language.conversations.authoring import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ( + AssignedProjectDeploymentsMetadata, + AssignedProjectDeploymentMetadata, +) + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + + +class TestConversations(AzureRecordedTestCase): + def create_client(self, endpoint, key): + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + + +class TestConversationsDeployProjectSync(TestConversations): + @ConversationsPreparer() + @recorded_by_proxy + def test_list_assigned_resource_deployments(self, authoring_endpoint, authoring_key): + # Arrange + client = self.create_client(authoring_endpoint, authoring_key) + paged = client.list_assigned_resource_deployments() + + # Assert + for meta in paged: + assert isinstance(meta, AssignedProjectDeploymentsMetadata) + assert isinstance(meta.project_name, str) and meta.project_name + assert isinstance(meta.deployments_metadata, list) + + for d in meta.deployments_metadata: + assert isinstance(d, AssignedProjectDeploymentMetadata) + assert isinstance(d.deployment_name, str) and d.deployment_name + assert isinstance(d.last_deployed_on, datetime) + assert isinstance(d.deployment_expires_on, date) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments_async.py new file mode 100644 index 000000000000..365b09991f22 --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_assigned_resource_deployments_async.py @@ -0,0 +1,47 @@ +import functools +import pytest +from datetime import date, datetime + +from devtools_testutils import EnvironmentVariableLoader, AzureRecordedTestCase +from devtools_testutils.aio import recorded_by_proxy_async +from azure.core.credentials import AzureKeyCredential +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import ( + AssignedProjectDeploymentsMetadata, + AssignedProjectDeploymentMetadata, +) + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + + +class TestConversationsAsync(AzureRecordedTestCase): + async def create_client(self, endpoint: str, key: str) -> ConversationAuthoringClient: + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + + +class TestConversationsDeployProjectAsync(TestConversationsAsync): + @ConversationsPreparer() + @recorded_by_proxy_async + @pytest.mark.asyncio + async def test_list_assigned_resource_deployments_async(self, authoring_endpoint, authoring_key): + client = await self.create_client(authoring_endpoint, authoring_key) + async with client: + # Act + paged = client.list_assigned_resource_deployments() + + # Assert + async for meta in paged: + assert isinstance(meta, AssignedProjectDeploymentsMetadata) + assert isinstance(meta.project_name, str) and meta.project_name + assert isinstance(meta.deployments_metadata, list) + + for d in meta.deployments_metadata: + assert isinstance(d, AssignedProjectDeploymentMetadata) + assert isinstance(d.deployment_name, str) and d.deployment_name + assert isinstance(d.last_deployed_on, datetime) + assert isinstance(d.deployment_expires_on, date) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py index 5c98303e7717..0820a8c9cd08 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources.py @@ -5,7 +5,7 @@ from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy from azure.core.credentials import AzureKeyCredential from azure.ai.language.conversations.authoring import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import AssignedDeploymentResource +from azure.ai.language.conversations.authoring.models import AssignedProjectResource ConversationsPreparer = functools.partial( EnvironmentVariableLoader, @@ -20,7 +20,7 @@ def create_client(self, endpoint, key): return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) -class TestConversationsDeployProjectSync(TestConversations): +class TestConversationsListProjectResourcesSync(TestConversations): @ConversationsPreparer() @recorded_by_proxy def test_list_project_resources(self, authoring_endpoint, authoring_key): @@ -29,8 +29,11 @@ def test_list_project_resources(self, authoring_endpoint, authoring_key): project_name = "EmailApp" project_client = client.get_project_client(project_name) - resources = list(project_client.project.list_project_resources()) - - for resource in resources: - assert resource.resource_id - assert resource.region + # Act + paged = project_client.project.list_project_resources() + + # Assert each resource item + for res in paged: + assert isinstance(res, AssignedProjectResource) + assert isinstance(res.resource_id, str) and res.resource_id + assert isinstance(res.region, str) and res.region diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources_async.py new file mode 100644 index 000000000000..0ea3d75aa62c --- /dev/null +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_list_project_resources_async.py @@ -0,0 +1,39 @@ +import functools +import pytest + +from devtools_testutils import EnvironmentVariableLoader, AzureRecordedTestCase +from devtools_testutils.aio import recorded_by_proxy_async +from azure.core.credentials import AzureKeyCredential +from azure.ai.language.conversations.authoring.aio import ConversationAuthoringClient +from azure.ai.language.conversations.authoring.models import AssignedProjectResource + +ConversationsPreparer = functools.partial( + EnvironmentVariableLoader, + "authoring", + authoring_endpoint="https://Sanitized.cognitiveservices.azure.com/", + authoring_key="fake_key", +) + + +class TestConversationsAsync(AzureRecordedTestCase): + async def create_client(self, endpoint: str, key: str) -> ConversationAuthoringClient: + return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + + +class TestConversationsListProjectResourcesAsync(TestConversationsAsync): + @ConversationsPreparer() + @recorded_by_proxy_async + @pytest.mark.asyncio + async def test_list_project_resources_async(self, authoring_endpoint, authoring_key): + client = await self.create_client(authoring_endpoint, authoring_key) + async with client: + project_client = client.get_project_client("EmailApp") + + # list_project_resources returns an AsyncItemPaged; no await on the call itself. + paged = project_client.project.list_project_resources() + + # Assert each resource item as we stream results + async for res in paged: + assert isinstance(res, AssignedProjectResource) + assert isinstance(res.resource_id, str) and res.resource_id + assert isinstance(res.region, str) and res.region 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 599ad0099798..3f7dd93a178e 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: f3deaa9de6e54581b74616193a6434aa05e4119b +commit: 9e6cf2d1c5285f3db3ee613500034319653e3592 repo: Azure/azure-rest-api-specs additionalDirectories: From f8d764c74a26dda826708c382d6334887989120b Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Thu, 13 Nov 2025 11:43:26 -0800 Subject: [PATCH 10/17] update assets.json --- .../azure-ai-language-conversations-authoring/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json index eb907a33d0b6..b46c9cfc5dae 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/cognitivelanguage/azure-ai-language-conversations-authoring", - "Tag": "python/cognitivelanguage/azure-ai-language-conversations-authoring_74372434b3" + "Tag": "python/cognitivelanguage/azure-ai-language-conversations-authoring_20102747af" } From 54412d83e6d4475a1b0abdd868f68f7bbef2c691 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Thu, 13 Nov 2025 17:03:11 -0800 Subject: [PATCH 11/17] updated readme --- .../README.md | 306 ++++++++++-------- 1 file changed, 171 insertions(+), 135 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md index 2dfdc79d7f8d..4a5443a7696a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/README.md @@ -34,7 +34,7 @@ Install the Azure Conversation Authoring client library for Python with [pip][pi pip install azure-ai-language-conversations-authoring ``` -> Note: This version of the client library defaults to the 2025-05-15-preview version of the service +> Note: This version of the client library defaults to the 2025-11-15-preview version of the service ### Authenticate the client @@ -129,181 +129,217 @@ The following examples show common **Conversation Authoring** scenarios using th ### Create a Conversation Project + + ```python -# import libraries import os -from azure.core.credentials import AzureKeyCredential +from azure.identity import DefaultAzureCredential from azure.ai.language.conversations.authoring import ConversationAuthoringClient -from azure.ai.language.conversations.authoring.models import CreateProjectOptions, ProjectKind +from azure.ai.language.conversations.authoring.models import ( + CreateProjectOptions, + ProjectKind, +) -# get secrets -endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] -key = os.environ["AZURE_CONVERSATIONS_AUTHORING_KEY"] -project_name = os.environ.get("PROJECT_NAME", "") +def sample_create_project(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") -# create client -client = ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + # create a client with AAD + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) -# create project -body = CreateProjectOptions( - project_kind=ProjectKind.CONVERSATION, - project_name=project_name, - language="", # e.g. "en-us" - multilingual=True, - description="Sample project created via Python SDK", -) + # build project definition + body = CreateProjectOptions( + project_kind=ProjectKind.CONVERSATION, + project_name=project_name, + language="", # e.g. "en-us" + multilingual=True, + description="Sample project created via Python SDK", + ) -# create project -result = client.create_project(project_name=project_name, body=body) + # create project + result = client.create_project(project_name=project_name, body=body) -# print project details (direct attribute access; no getattr) -print("=== Create Project Result ===") -print(f"Project Name: {result.project_name}") -print(f"Language: {result.language}") -print(f"Kind: {result.project_kind}") -print(f"Multilingual: {result.multilingual}") -print(f"Description: {result.description}") + # print project details (direct attribute access; no getattr) + print("=== Create Project Result ===") + print(f"Project Name: {result.project_name}") + print(f"Language: {result.language}") + print(f"Kind: {result.project_kind}") + print(f"Multilingual: {result.multilingual}") + print(f"Description: {result.description}") ``` + + ### Import a Project + + ```python import os -from azure.core.credentials import AzureKeyCredential +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError from azure.ai.language.conversations.authoring import ConversationAuthoringClient from azure.ai.language.conversations.authoring.models import ( - ExportedProject, CreateProjectOptions, ProjectKind, ProjectSettings + ConversationExportedIntent, + ConversationExportedEntity, + ConversationExportedUtterance, + ExportedUtteranceEntityLabel, + ConversationExportedProjectAsset, + CreateProjectOptions, + ProjectKind, + ProjectSettings, + ExportedProject, + ExportedProjectFormat, ) -endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] -key = os.environ["AZURE_CONVERSATIONS_AUTHORING_KEY"] -project_name = os.environ.get("PROJECT_NAME", "") - -client = ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) -project_client = client.get_project_client(project_name) - -# Build assets using objects -intents = [ - ConversationExportedIntent(category=""), - ConversationExportedIntent(category=""), -] -entities = [ - ConversationExportedEntity( - category="", - composition_mode="combineComponents", +def sample_import_project(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # create a client with AAD + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # ----- Build assets using objects ----- + intents = [ + ConversationExportedIntent(category=""), + ConversationExportedIntent(category=""), + ] + + entities = [ + ConversationExportedEntity( + category="", + composition_mode="combineComponents", + ) + ] + + u1 = ConversationExportedUtterance( + text="", + intent="", + language="", # e.g., "en-us" + dataset="Train", + entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=5)], ) -] - -u1 = ConversationExportedUtterance( - text="", - intent="", - language="", # e.g., "en-us" - dataset="Train", - entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=5)], -) -u2 = ConversationExportedUtterance( - text="", - intent="", - language="", - dataset="Train", - entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=5)], -) + u2 = ConversationExportedUtterance( + text="", + intent="", + language="", + dataset="Train", + entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=5)], + ) -u3 = ConversationExportedUtterance( - text="", - intent="", - language="", - dataset="Train", - entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=4)], -) + u3 = ConversationExportedUtterance( + text="", + intent="", + language="", + dataset="Train", + entities=[ExportedUtteranceEntityLabel(category="", offset=0, length=4)], + ) -assets = ConversationExportedProjectAsset( - intents=intents, - entities=entities, - utterances=[u1, u2, u3], -) + assets = ConversationExportedProjectAsset( + intents=intents, + entities=entities, + utterances=[u1, u2, u3], + ) -metadata = CreateProjectOptions( - project_kind=ProjectKind.CONVERSATION, - project_name=project_name, # required - language="", # required (e.g., "en-us") - settings=ProjectSettings(confidence_threshold=0.0), - multilingual=False, - description="", -) + metadata = CreateProjectOptions( + project_kind=ProjectKind.CONVERSATION, + project_name=project_name, # required + language="", # required (e.g., "en-us") + settings=ProjectSettings(confidence_threshold=0.0), + multilingual=False, + description="", + ) -exported_project = ExportedProject( - project_file_version="", # e.g., "2025-05-15-preview" - string_index_type="Utf16CodeUnit", - metadata=metadata, - assets=assets, -) + exported_project = ExportedProject( + project_file_version="", # e.g., "2025-05-15-preview" + string_index_type="Utf16CodeUnit", + metadata=metadata, + assets=assets, + ) -# begin import (long-running operation) -poller = project_client.project.begin_import( - body=exported_project, - exported_project_format=ExportedProjectFormat.CONVERSATION, -) + # ----- begin import (long-running operation) ----- + poller = project_client.project.begin_import( + body=exported_project, + exported_project_format=ExportedProjectFormat.CONVERSATION, + ) -try: - poller.result() - print("Import completed.") - print(f"done: {poller.done()}") - print(f"status: {poller.status()}") -except HttpResponseError as e: - msg = getattr(getattr(e, "error", None), "message", str(e)) - print(f"Operation failed: {msg}") + try: + poller.result() + print("Import completed.") + print(f"done: {poller.done()}") + print(f"status: {poller.status()}") + except HttpResponseError as e: + print(f"Operation failed: {e.message}") + print(e.error) ``` + + ### Train a Model + + ```python import os -from azure.core.credentials import AzureKeyCredential +from azure.identity import DefaultAzureCredential from azure.ai.language.conversations.authoring import ConversationAuthoringClient from azure.ai.language.conversations.authoring.models import ( - TrainingJobDetails, TrainingMode, EvaluationDetails, EvaluationKind + TrainingJobDetails, + TrainingMode, + EvaluationDetails, + EvaluationKind, ) -endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] -key = os.environ["AZURE_CONVERSATIONS_AUTHORING_KEY"] -project_name = os.environ.get("PROJECT_NAME", "") - -client = ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) -project_client = client.get_project_client(project_name) - -# build training request -training_job_details = TrainingJobDetails( - model_label="", - training_mode=TrainingMode.STANDARD, - training_config_version="", - evaluation_options=EvaluationDetails( - kind=EvaluationKind.PERCENTAGE, - testing_split_percentage=20, - training_split_percentage=80, - ), -) -# start training job (long-running operation) -poller = project_client.project.begin_train(body=training_job_details) - -# wait for job completion and get the result (no explicit type variables) -result = poller.result() - -# print result details -print("=== Training Result ===") -print(f"Model Label: {result.model_label}") -print(f"Training Config Version: {result.training_config_version}") -print(f"Training Mode: {result.training_mode}") -print(f"Training Status: {result.training_status}") -print(f"Data Generation Status: {result.data_generation_status}") -print(f"Evaluation Status: {result.evaluation_status}") -print(f"Estimated End: {result.estimated_end_on}") +def sample_train(): + # settings + endpoint = os.environ["AZURE_CONVERSATIONS_AUTHORING_ENDPOINT"] + project_name = os.environ.get("PROJECT_NAME", "") + + # create a client with AAD + credential = DefaultAzureCredential() + client = ConversationAuthoringClient(endpoint, credential=credential) + project_client = client.get_project_client(project_name) + + # build training request + training_job_details = TrainingJobDetails( + model_label="", + training_mode=TrainingMode.STANDARD, + training_config_version="", + evaluation_options=EvaluationDetails( + kind=EvaluationKind.PERCENTAGE, + testing_split_percentage=20, + training_split_percentage=80, + ), + ) + + # start training job (long-running operation) + poller = project_client.project.begin_train(body=training_job_details) + + # wait for job completion and get the result (no explicit type variables) + result = poller.result() + + # print result details + print("=== Training Result ===") + print(f"Model Label: {result.model_label}") + print(f"Training Config Version: {result.training_config_version}") + print(f"Training Mode: {result.training_mode}") + print(f"Training Status: {result.training_status}") + print(f"Data Generation Status: {result.data_generation_status}") + print(f"Evaluation Status: {result.evaluation_status}") + print(f"Estimated End: {result.estimated_end_on}") ``` + + ## Optional Configuration Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation][azure_core_ref_docs] describes available configurations for retries, logging, transport protocols, and more. From 8d5940317d9ba54a698bc5821fec95cf56bfe853 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Thu, 13 Nov 2025 17:22:17 -0800 Subject: [PATCH 12/17] update samples readme --- .../samples/README.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md index 7b4ca5a2ffdd..e1e98c2b4e65 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/README.md @@ -38,6 +38,12 @@ These sample programs show common scenarios for the Conversation Authoring clien | [sample_swap_deployments.py][sample_swap_deployments] and [sample_swap_deployments_async.py][sample_swap_deployments_async] | Swap two deployments within a project. | | [sample_train.py][sample_train] and [sample_train_async.py][sample_train_async] | Train a model within a project. | | [sample_unassign_project_resources.py][sample_unassign_project_resources] and [sample_unassign_project_resources_async.py][sample_unassign_project_resources_async] | Unassign deployment resources from a project. | +| [sample_list_project_resources.py][sample_list_project_resources] and [sample_list_project_resources_async.py][sample_list_project_resources_async] | List all deployment-level resources currently assigned to a project. | +| [sample_get_assign_project_resources_status.py][sample_get_assign_project_resources_status] and [sample_get_assign_project_resources_status_async.py][sample_get_assign_project_resources_status_async] | Get the operation status of a resource-assignment request. | +| [sample_get_unassign_project_resources_status.py][sample_get_unassign_project_resources_status] and [sample_get_unassign_project_resources_status_async.py][sample_get_unassign_project_resources_status_async] | Get the operation status of a resource-unassignment request. | +| [sample_list_assigned_resource_deployments.py][sample_list_assigned_resource_deployments] and [sample_list_assigned_resource_deployments_async.py][sample_list_assigned_resource_deployments_async] | List all deployments associated with a specific assigned resource. | +| [sample_delete_deployment_from_resources.py][sample_delete_deployment_from_resources] and [sample_delete_deployment_from_resources_async.py][sample_delete_deployment_from_resources_async] | Delete a deployment from the project’s assigned resources. | +| [sample_get_deployment_delete_from_resources_status.py][sample_get_deployment_delete_from_resources_status] and [sample_get_deployment_delete_from_resources_status_async.py][sample_get_deployment_delete_from_resources_status_async] | Get the status of a deployment-deletion operation from project resources. | --- @@ -130,4 +136,22 @@ Check out the [API reference documentation][api_reference_authoring] to explore [sample_unassign_project_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_unassign_project_resources.py [sample_unassign_project_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_unassign_project_resources_async.py +[sample_list_project_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_project_resources.py +[sample_list_project_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_project_resources_async.py + +[sample_get_assign_project_resources_status]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py +[sample_get_assign_project_resources_status_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py + +[sample_get_unassign_project_resources_status]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py +[sample_get_unassign_project_resources_status_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py + +[sample_list_assigned_resource_deployments]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_list_assigned_resource_deployments.py +[sample_list_assigned_resource_deployments_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_list_assigned_resource_deployments_async.py + +[sample_delete_deployment_from_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py +[sample_delete_deployment_from_resources_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py + +[sample_get_deployment_delete_from_resources_status]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py +[sample_get_deployment_delete_from_resources_status_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py + [versioning_story_readme]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cognitivelanguage/azure-ai-language-conversations-authoring#install-the-package \ No newline at end of file From fd56b25202dc98aeee809db3d1c969c4ef9b5763 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 14 Nov 2025 10:18:04 -0800 Subject: [PATCH 13/17] fix spell check --- .vscode/cspell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f3507259eada..8b7e1e102f65 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -907,7 +907,7 @@ }, { "filename": "sdk/cognitivelanguage/azure-ai-language-conversations-authoring/**", - "words": [ "unassigning" ], + "words": [ "unassigning", "unassignment" ], "caseSensitive": false }, { From d11b28b9d2ebea0c2b511214efbd1db59d256925 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 14 Nov 2025 11:47:36 -0800 Subject: [PATCH 14/17] fix pylint --- .../authoring/_utils/model_base.py | 4 +-- .../authoring/aio/operations/_operations.py | 2 +- .../authoring/aio/operations/_patch.py | 3 ++- .../aio/operations/_project_op_patch.py | 20 +++++--------- .../conversations/authoring/models/_models.py | 8 ++++++ .../conversations/authoring/models/_patch.py | 16 +++++++----- .../authoring/operations/_operations.py | 2 +- .../authoring/operations/_patch.py | 3 ++- .../authoring/operations/_project_op_patch.py | 26 ++++++------------- ..._delete_deployment_from_resources_async.py | 5 ++-- ...t_assign_project_resources_status_async.py | 1 + ...ment_delete_from_resources_status_async.py | 1 + ...unassign_project_resources_status_async.py | 1 + ...sample_delete_deployment_from_resources.py | 4 +-- ...ple_get_assign_project_resources_status.py | 1 + ...deployment_delete_from_resources_status.py | 1 + ...e_get_unassign_project_resources_status.py | 1 + ..._delete_deployment_from_resources_async.py | 2 ++ .../tsp-location.yaml | 2 +- 19 files changed, 51 insertions(+), 52 deletions(-) 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 12926fa98dcf..430bda7b37fc 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 +from collections.abc import MutableMapping # pylint:disable=import-error 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) + return super().__new__(cls) # pylint:disable=no-value-for-parameter 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/aio/operations/_operations.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/aio/operations/_operations.py index c831d56221f9..32e8759647ed 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 +from collections.abc import MutableMapping # pylint:disable=import-error from io import IOBase import json from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload 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 de420e5960c8..d16191ea330a 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 @@ -9,6 +9,7 @@ """ from ._project_op_patch import ProjectOperations + def patch_sdk(): """Do not remove from this file. `patch_sdk` is a last resort escape hatch that allows you to do customizations @@ -17,4 +18,4 @@ def patch_sdk(): """ -__all__ = ["ProjectOperations"] \ No newline at end of file +__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 index 446840525f87..9e09ee691be6 100644 --- 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 @@ -7,10 +7,9 @@ """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 IO, Any, Callable, Dict, Optional, TypeVar, Union, cast, overload +from collections.abc import MutableMapping # pylint:disable=import-error +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast -from azure.core.async_paging import AsyncItemPaged from azure.core.pipeline import PipelineResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest, HttpResponse @@ -26,22 +25,15 @@ JSON = MutableMapping[str, Any] T = TypeVar("T") _Unset: Any = object() -ClsType = Optional[ - Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any] -] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ProjectOperations(ProjectOperationsGenerated): """Patched ProjectOperationsOperations that auto-injects project_name.""" - def __init__(self, *args, **kwargs: Any): - super().__init__(*args, **kwargs) - @distributed_trace_async async def begin_cancel_training_job( # type: ignore[override] - self, - job_id: str, - **kwargs: Any + self, job_id: str, **kwargs: Any ) -> AsyncLROPoller[TrainingJobResult]: """ Cancel a training job. @@ -106,7 +98,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[TrainingJobResult]( self._client, - initial, # type: ignore + initial, # type: ignore get_long_running_output, polling_method, # type: ignore[arg-type] - ) \ No newline at end of file + ) 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 18177eb1ff69..1a7d9787fed1 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 @@ -104,18 +104,26 @@ class AssignedProjectResource(_Model): :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 """ 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"] + ) + """Represents the AOAI resource assigned for data generation.""" @overload def __init__( self, *, region: str, + assigned_aoai_resource: Optional["_models.DataGenerationConnectionInfo"] = 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 0eb33dfa8905..0772ff2eeb67 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 @@ -7,7 +7,7 @@ """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 collections.abc import MutableMapping, Awaitable # pylint:disable=import-error from typing import Any, Callable, Optional, Tuple, TypeVar, cast import base64 @@ -55,7 +55,6 @@ T = TypeVar("T") - class _JobsStrategy(LongRunningOperation): """Interprets job-status responses and tells the poller which URL to use.""" @@ -108,7 +107,7 @@ def __init__(self, polling_interval: float = 30.0, *, path_format_arguments: Opt 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._operation: Any = None # or a concrete type if available self._command: Optional[Callable[[], PipelineResponse]] = None # ---- LRO lifecycle ---- @@ -192,7 +191,8 @@ def _do_get(self, url: str) -> PipelineResponse: # Legacy pipeline fallback request = self._client.get(url) return cast( - PipelineResponse, self._client._pipeline.run(request, stream=False, **self._kwargs) # pylint: disable=protected-access + PipelineResponse, + self._client._pipeline.run(request, stream=False, **self._kwargs), # pylint: disable=protected-access ) # ---- Continuation token support (doc pattern) ---- @@ -237,8 +237,8 @@ def initialize(self, client: Any, initial_response: PipelineResponse, deserializ 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 + self._resource = None # no type annotation here + self._status = "InProgress" # no type annotation here # Operation-Location (case-insensitive) headers = initial_response.http_response.headers @@ -279,6 +279,7 @@ async def _sleep(self, seconds: float) -> None: 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: @@ -340,6 +341,7 @@ def from_continuation_token(cls, continuation_token: str, **kwargs: Any) -> Tupl initial_response = pickle.loads(base64.b64decode(continuation_token)) # nosec return client, initial_response, deserialization_callback + def patch_sdk(): """Do not remove from this file. `patch_sdk` is a last resort escape hatch that allows you to do customizations @@ -374,4 +376,4 @@ def patch_sdk(): "ConversationExportedUtterance", "ExportedUtteranceEntityLabel", "ResourceMetadata", -] \ No newline at end of file +] 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 a628bf3b1964..c6bb26044905 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 +from collections.abc import MutableMapping # pylint:disable=import-error from io import IOBase import json from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload 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 de420e5960c8..d16191ea330a 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 @@ -9,6 +9,7 @@ """ from ._project_op_patch import ProjectOperations + def patch_sdk(): """Do not remove from this file. `patch_sdk` is a last resort escape hatch that allows you to do customizations @@ -17,4 +18,4 @@ def patch_sdk(): """ -__all__ = ["ProjectOperations"] \ No newline at end of file +__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 index f2dbc299b583..8945d2652d62 100644 --- 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 @@ -7,8 +7,8 @@ """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 IO, Any, Callable, Dict, Optional, TypeVar, Union, cast +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 @@ -17,34 +17,24 @@ from .._utils.model_base import _deserialize from ..models._patch import _JobsPollingMethod -from ..models import ( - TrainingJobResult -) +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] -] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ProjectOperations(ProjectOperationsGenerated): - """Patched ProjectOperationsOperations that auto-injects project_name.""" - def __init__(self, *args, **kwargs: Any): - super().__init__(*args, **kwargs) - @distributed_trace def begin_cancel_training_job( # pylint: disable=function-redefined - self, - job_id: str, - **kwargs: Any + 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. @@ -111,10 +101,10 @@ def get_long_running_output(pipeline_response): # 6) Return the poller return LROPoller[TrainingJobResult]( self._client, - initial, # type: ignore + 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 - # ) \ No newline at end of file + # ) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py index 4ea5547629af..fd1833eca5ec 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_delete_deployment_from_resources_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. @@ -50,9 +51,7 @@ async def sample_delete_deployment_from_resources_async(): async with ConversationAuthoringClient(endpoint, credential=credential) as client: project_client = client.get_project_client(project_name) - delete_body = ProjectResourceIds( - azure_resource_ids=[resource_id] - ) + delete_body = ProjectResourceIds(azure_resource_ids=[resource_id]) # start delete-from-resources (async long-running operation) poller = await project_client.deployment.begin_delete_deployment_from_resources( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py index c15941f3feef..c4874c9cb75a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_assign_project_resources_status_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py index e41a9949621f..af434372ecb2 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_deployment_delete_from_resources_status_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py index 2cbd82b8fbcc..bea05a59ad1c 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/async/sample_get_unassign_project_resources_status_async.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py index 33a44264ddec..cd5f612a2ebc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_delete_deployment_from_resources.py @@ -49,9 +49,7 @@ def sample_delete_deployment_from_resources(): client = ConversationAuthoringClient(endpoint, credential=credential) project_client = client.get_project_client(project_name) - delete_body = ProjectResourceIds( - azure_resource_ids=[resource_id] - ) + delete_body = ProjectResourceIds(azure_resource_ids=[resource_id]) # start delete-from-resources (long-running operation) poller = project_client.deployment.begin_delete_deployment_from_resources( diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py index b5bc0d2257fc..27f884d05261 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_assign_project_resources_status.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py index bae765611707..f2fe27a9b181 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_deployment_delete_from_resources_status.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py index 8eb5af886987..ca2c390ebefc 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/samples/sample_get_unassign_project_resources_status.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py index 185f429b2ee6..8581410afd48 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/tests/test_delete_deployment_from_resources_async.py @@ -16,10 +16,12 @@ authoring_key="fake_key", ) + class TestConversationsAsync(AzureRecordedTestCase): async def create_client(self, endpoint: str, key: str) -> ConversationAuthoringClient: return ConversationAuthoringClient(endpoint, AzureKeyCredential(key)) + class TestConversationsDeleteDeploymentFromResourcesAsync(TestConversationsAsync): @ConversationsPreparer() @recorded_by_proxy_async 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 3f7dd93a178e..8f1d414b7cc9 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: 9e6cf2d1c5285f3db3ee613500034319653e3592 +commit: 220549c6a9ec23f681e4e3eda90189beacb7937b repo: Azure/azure-rest-api-specs additionalDirectories: From dc4d3e33e3db08a764a4cc7a9891c92fef54cb2d Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 14 Nov 2025 13:40:30 -0800 Subject: [PATCH 15/17] add breaking changes in changelog --- .../CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md index 955e8e17c5ba..66f05e99b947 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 1.0.0b2 (2025-11-14) + +### Features Added +- Added support for service version 2024-05-01, 2024-11-01, 2024-11-15-preview,2025-05-15-preview. + + +### Breaking Changes +- Changed parameter type from `DeleteDeploymentOptions` to `ProjectResourceIds` when calling `DeleteDeploymentFromResources`, with property name changed from `assignedResourceIds` to `azureResourceIds`. +- Changed function name from `list_deployment_Resources` to `list_project_resources`, change its return type from `AssignedDeploymentResource` to `ProjectResourceInfo`. +- changed function name from `assign_deployment_resources` to `assign_project_resources` +- changed function name from `unassign_deployment_resources` to `unassign_project_resources`, changed its parameter type from `UnassignDeploymentOptions` to `ProjectAzureResourceIds` +- changed function name from `get_assign_deployment_resources_status` to `get_assign_project_resources_status`, change its return type from `DeploymentResourcesJobState` to `ProjectResourcesJobState`. +- changed function name from `get_unassign_deployment_resources_status` to `get_unassign_project_resources_status`, change its return type from `DeploymentResourcesJobState` to `ProjectResourcesJobState`. + +### Other Changes +* This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported. + ## 1.0.0b1 (2025-09-05) ### Features Added From 38b14cfb66712ade0dfef6c80ff540c996031671 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 14 Nov 2025 14:04:26 -0800 Subject: [PATCH 16/17] updated change logs --- .../CHANGELOG.md | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md index 66f05e99b947..33c2ec2acf19 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md @@ -3,20 +3,30 @@ ## 1.0.0b2 (2025-11-14) ### Features Added -- Added support for service version 2024-05-01, 2024-11-01, 2024-11-15-preview,2025-05-15-preview. - +- Added support for service version 2025-11-15-preview. ### Breaking Changes -- Changed parameter type from `DeleteDeploymentOptions` to `ProjectResourceIds` when calling `DeleteDeploymentFromResources`, with property name changed from `assignedResourceIds` to `azureResourceIds`. -- Changed function name from `list_deployment_Resources` to `list_project_resources`, change its return type from `AssignedDeploymentResource` to `ProjectResourceInfo`. -- changed function name from `assign_deployment_resources` to `assign_project_resources` -- changed function name from `unassign_deployment_resources` to `unassign_project_resources`, changed its parameter type from `UnassignDeploymentOptions` to `ProjectAzureResourceIds` -- changed function name from `get_assign_deployment_resources_status` to `get_assign_project_resources_status`, change its return type from `DeploymentResourcesJobState` to `ProjectResourcesJobState`. -- changed function name from `get_unassign_deployment_resources_status` to `get_unassign_project_resources_status`, change its return type from `DeploymentResourcesJobState` to `ProjectResourcesJobState`. +- Changed parameter type from `DeleteDeploymentDetails` to `ProjectResourceIds` when calling `begin_delete_deployment_from_resources`, with property name changed from `assigned_resource_ids` to `azure_resource_ids`. -### Other Changes -* This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported. +- Changed function name from `list_deployment_Resources` to `list_project_resources`, change its return type from `AssignedDeploymentResource` to `AssignedProjectResource`. + +- Changed function name from `begin_assign_deployment_resources` to `begin_assign_project_resources`, and its paramter type from `AssignDeploymentResourcesDetails` to `AssignProjectResourcesDetails`. + +- Changed function name from `begin_unassign_deployment_resources` to `begin_unassign_project_resources`, changed its parameter type from `UnassignDeploymentResourcesDetails` to `ProjectResourceIds`. +- Changed function name from `get_assign_deployment_resources_status` to `get_assign_project_resources_status`, change its return type from `DeploymentResourcesState` to `ProjectResourcesState`. + +- Changed function name from `get_unassign_deployment_resources_status` to `get_unassign_project_resources_status`, change its return type from `DeploymentResourcesState` to `ProjectResourcesState`. + +### Other Changes +- Add samples for the following functions(sync and async): + - list_assigned_resource_deployments + - list_project_resources + - delete_deployment_from_resources + - get_assign_project_resources_status + - get_unassign_project_resources_status + - get_deployment_delete_from_resources_status + ## 1.0.0b1 (2025-09-05) ### Features Added From e8def9d765a52a9a4538385e31bddf5e430e5ca9 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Fri, 14 Nov 2025 14:27:46 -0800 Subject: [PATCH 17/17] fix --- .../azure-ai-language-conversations-authoring/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md index 33c2ec2acf19..696965b3582a 100644 --- a/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md +++ b/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/CHANGELOG.md @@ -10,7 +10,7 @@ - Changed function name from `list_deployment_Resources` to `list_project_resources`, change its return type from `AssignedDeploymentResource` to `AssignedProjectResource`. -- Changed function name from `begin_assign_deployment_resources` to `begin_assign_project_resources`, and its paramter type from `AssignDeploymentResourcesDetails` to `AssignProjectResourcesDetails`. +- Changed function name from `begin_assign_deployment_resources` to `begin_assign_project_resources`, and its parameter type from `AssignDeploymentResourcesDetails` to `AssignProjectResourcesDetails`. - Changed function name from `begin_unassign_deployment_resources` to `begin_unassign_project_resources`, changed its parameter type from `UnassignDeploymentResourcesDetails` to `ProjectResourceIds`.