From d610231688855633273cdf73e47bc6f8f1fc9b74 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 15 Oct 2026 18:22:15 +0000 Subject: [PATCH 1/4] Configurations: 'specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask/tspconfig.yaml', and CommitSHA: 'd218330c5a3b727df9504ba852e97259479e8fef' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6962944 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-durabletask/CHANGELOG.md | 42 + .../azure-mgmt-durabletask/README.md | 6 +- .../azure-mgmt-durabletask/_metadata.json | 11 +- sdk/durabletask/azure-mgmt-durabletask/api.md | 2596 +++++++++ .../azure-mgmt-durabletask/api.metadata.yml | 4 + .../apiview-properties.json | 70 +- .../azure/mgmt/durabletask/_client.py | 44 +- .../azure/mgmt/durabletask/_configuration.py | 12 +- .../azure/mgmt/durabletask/_patch.py | 1 - .../mgmt/durabletask/_utils/model_base.py | 604 ++- .../mgmt/durabletask/_utils/serialization.py | 144 +- .../azure/mgmt/durabletask/_version.py | 2 +- .../azure/mgmt/durabletask/aio/_client.py | 44 +- .../mgmt/durabletask/aio/_configuration.py | 12 +- .../azure/mgmt/durabletask/aio/_patch.py | 1 - .../durabletask/aio/operations/__init__.py | 8 + .../durabletask/aio/operations/_operations.py | 3201 ++++++++++- .../mgmt/durabletask/aio/operations/_patch.py | 1 - .../azure/mgmt/durabletask/models/__init__.py | 50 + .../azure/mgmt/durabletask/models/_enums.py | 99 +- .../azure/mgmt/durabletask/models/_models.py | 778 ++- .../azure/mgmt/durabletask/models/_patch.py | 1 - .../mgmt/durabletask/operations/__init__.py | 8 + .../durabletask/operations/_operations.py | 4791 ++++++++++++++--- .../mgmt/durabletask/operations/_patch.py | 1 - .../azure/mgmt/durabletask/types.py | 721 +++ .../generated_samples/detectors_get.py | 43 + .../detectors_list_by_scheduler.py | 43 + ...ances_create_or_replace_maximum_set_gen.py | 48 + ...ilover_instances_delete_maximum_set_gen.py | 41 + .../failover_instances_failover.py | 42 + ...nstances_force_failover_allow_data_loss.py | 42 + .../failover_instances_get_maximum_set_gen.py | 42 + ...ances_list_by_scheduler_maximum_set_gen.py | 43 + .../generated_samples/operations_list.py | 2 +- ...oint_connections_create_maximum_set_gen.py | 2 +- ...oint_connections_delete_maximum_set_gen.py | 2 +- ...ndpoint_connections_get_maximum_set_gen.py | 2 +- ...dpoint_connections_list_maximum_set_gen.py | 2 +- .../private_endpoint_connections_update.py | 2 +- ...vate_link_resources_get_maximum_set_gen.py | 2 +- ...ate_link_resources_list_maximum_set_gen.py | 2 +- ...icies_create_or_replace_maximum_set_gen.py | 2 +- ...tention_policies_delete_maximum_set_gen.py | 2 +- .../retention_policies_get_maximum_set_gen.py | 2 +- ...icies_list_by_scheduler_maximum_set_gen.py | 2 +- ...tention_policies_update_maximum_set_gen.py | 2 +- .../schedulers_create_or_update.py | 9 +- .../generated_samples/schedulers_delete.py | 2 +- .../generated_samples/schedulers_get.py | 2 +- .../schedulers_list_by_resource_group.py | 2 +- .../schedulers_list_by_subscription.py | 2 +- .../generated_samples/schedulers_restart.py | 41 + .../generated_samples/schedulers_update.py | 3 +- .../task_hubs_create_or_update.py | 4 +- .../generated_samples/task_hubs_delete.py | 2 +- .../generated_samples/task_hubs_get.py | 2 +- .../task_hubs_list_by_scheduler.py | 2 +- .../task_queues_create_or_update.py | 45 + ...ask_queues_create_or_update_minimum_set.py | 45 + .../generated_samples/task_queues_delete.py | 43 + .../generated_samples/task_queues_get.py | 44 + .../task_queues_list_by_task_hub.py | 44 + .../generated_samples/task_queues_update.py | 45 + ...tions_create_or_replace_maximum_set_gen.py | 49 + ...data_encryptions_delete_maximum_set_gen.py | 41 + ...nt_data_encryptions_get_maximum_set_gen.py | 42 + ...tions_list_by_scheduler_maximum_set_gen.py | 43 + ..._durable_task_mgmt_detectors_operations.py | 42 + ...le_task_mgmt_detectors_operations_async.py | 43 + ...task_mgmt_failover_instances_operations.py | 105 + ...gmt_failover_instances_operations_async.py | 114 + ...durable_task_mgmt_schedulers_operations.py | 23 + ...e_task_mgmt_schedulers_operations_async.py | 23 + ..._durable_task_mgmt_task_hubs_operations.py | 2 +- ...le_task_mgmt_task_hubs_operations_async.py | 2 +- ...urable_task_mgmt_task_queues_operations.py | 98 + ..._task_mgmt_task_queues_operations_async.py | 105 + ...transparent_data_encryptions_operations.py | 82 + ...arent_data_encryptions_operations_async.py | 87 + .../azure-mgmt-durabletask/pyproject.toml | 8 +- .../azure-mgmt-durabletask/tsp-location.yaml | 4 +- 82 files changed, 13742 insertions(+), 1130 deletions(-) create mode 100644 sdk/durabletask/azure-mgmt-durabletask/api.md create mode 100644 sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml create mode 100644 sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py create mode 100644 sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py diff --git a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md index 837e55f94f5a..e26e3bc70565 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md @@ -1,5 +1,47 @@ # Release History +## 1.2.0b1 (2026-10-15) + +### Features Added + + - Client `DurableTaskMgmtClient` added operation group `detectors` + - Client `DurableTaskMgmtClient` added operation group `failover_instances` + - Client `DurableTaskMgmtClient` added operation group `task_queues` + - Client `DurableTaskMgmtClient` added operation group `transparent_data_encryptions` + - Model `Scheduler` added property `identity` + - Model `SchedulerUpdate` added property `identity` + - Model `TaskHubProperties` added property `capabilities` + - Added model `Detector` + - Added model `DetectorDataset` + - Added model `DetectorMetadata` + - Added model `DetectorProperties` + - Added model `DetectorRenderingProperties` + - Added enum `DetectorRenderingType` + - Added model `DetectorStatus` + - Added enum `DetectorStatusId` + - Added model `DetectorTable` + - Added model `DetectorTableColumn` + - Added enum `DetectorType` + - Added model `FailoverInstance` + - Added model `FailoverInstanceProperties` + - Added enum `FailoverState` + - Added model `ManagedServiceIdentity` + - Added enum `ManagedServiceIdentityType` + - Added enum `ReplicationRole` + - Added model `TaskQueue` + - Added model `TaskQueueProperties` + - Added model `TaskQueueThroughput` + - Added model `TaskQueueUpdate` + - Added model `TransparentDataEncryption` + - Added enum `TransparentDataEncryptionKeySource` + - Added model `TransparentDataEncryptionProperties` + - Added model `UserAssignedIdentity` + - Model `SchedulersOperations` added method `restart` + - Added operation group `DetectorsOperations` + - Added operation group `FailoverInstancesOperations` + - Added operation group `TaskQueuesOperations` + - Added operation group `TransparentDataEncryptionsOperations` + ## 1.1.0 (2026-03-09) ### Features Added diff --git a/sdk/durabletask/azure-mgmt-durabletask/README.md b/sdk/durabletask/azure-mgmt-durabletask/README.md index dbdf7b3f22de..21085ea54b0b 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/README.md +++ b/sdk/durabletask/azure-mgmt-durabletask/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Durabletask Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json index 2a003262371c..1c61ae5840d8 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json +++ b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2026-02-01", + "apiVersion": "2026-07-01-preview", "apiVersions": { - "Microsoft.DurableTask": "2026-02-01" + "Microsoft.DurableTask": "2026-07-01-preview" }, - "commit": "a86317f00c71ef51aab7f78e6f4a2be3cf58f2cd", + "commit": "d218330c5a3b727df9504ba852e97259479e8fef", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/durabletask/DurableTask.Management", - "emitterVersion": "0.60.2" + "typespec_src": "specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask", + "emitterVersion": "0.63.10", + "httpClientPythonVersion": "0.39.0" } \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/api.md b/sdk/durabletask/azure-mgmt-durabletask/api.md new file mode 100644 index 000000000000..d1c0ac9b0d23 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/api.md @@ -0,0 +1,2596 @@ +```py +namespace azure.mgmt.durabletask + + class azure.mgmt.durabletask.DurableTaskMgmtClient: implements ContextManager + detectors: DetectorsOperations + failover_instances: FailoverInstancesOperations + operations: Operations + retention_policies: RetentionPoliciesOperations + schedulers: SchedulersOperations + task_hubs: TaskHubsOperations + task_queues: TaskQueuesOperations + transparent_data_encryptions: TransparentDataEncryptionsOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.durabletask.aio + + class azure.mgmt.durabletask.aio.DurableTaskMgmtClient: implements AsyncContextManager + detectors: DetectorsOperations + failover_instances: FailoverInstancesOperations + operations: Operations + retention_policies: RetentionPoliciesOperations + schedulers: SchedulersOperations + task_hubs: TaskHubsOperations + task_queues: TaskQueuesOperations + transparent_data_encryptions: TransparentDataEncryptionsOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.durabletask.aio.operations + + class azure.mgmt.durabletask.aio.operations.DetectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'detector_id', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + detector_id: str, + **kwargs: Any + ) -> Detector: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Detector]: ... + + + class azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def begin_failover( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def begin_force_failover_allow_data_loss( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[FailoverInstance]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> FailoverInstance: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[FailoverInstance]: ... + + + class azure.mgmt.durabletask.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RetentionPolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> RetentionPolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[RetentionPolicy]: ... + + + class azure.mgmt.durabletask.aio.operations.SchedulersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Scheduler]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @overload + async def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PrivateEndpointConnection]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> Scheduler: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_link_resource_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + async def get_private_link( + self, + resource_group_name: str, + scheduler_name: str, + private_link_resource_name: str, + **kwargs: Any + ) -> SchedulerPrivateLinkResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Scheduler]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Scheduler]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateEndpointConnection]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_links( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SchedulerPrivateLinkResource]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def restart( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.durabletask.aio.operations.TaskHubsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskHub]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> TaskHub: ... + + @distributed_trace + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TaskHub]: ... + + + class azure.mgmt.durabletask.aio.operations.TaskQueuesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name']}, api_versions_list=['2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TaskQueue]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> TaskQueue: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_task_hub( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TaskQueue]: ... + + + class azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[TransparentDataEncryption]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + async def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> TransparentDataEncryption: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> AsyncItemPaged[TransparentDataEncryption]: ... + + +namespace azure.mgmt.durabletask.models + + class azure.mgmt.durabletask.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.durabletask.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.durabletask.models.Detector(ProxyResource): + id: str + name: str + properties: Optional[DetectorProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[DetectorProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.DetectorDataset(_Model): + rendering_properties: Optional[DetectorRenderingProperties] + table: Optional[DetectorTable] + + + class azure.mgmt.durabletask.models.DetectorMetadata(_Model): + analysis_types: Optional[list[str]] + author: Optional[str] + category: Optional[str] + description: Optional[str] + id: Optional[str] + name: Optional[str] + score: Optional[float] + support_topic_list: Optional[list[str]] + type: Optional[Union[str, DetectorType]] + + + class azure.mgmt.durabletask.models.DetectorProperties(_Model): + dataset: Optional[list[DetectorDataset]] + metadata: Optional[DetectorMetadata] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[DetectorStatus] + + + class azure.mgmt.durabletask.models.DetectorRenderingProperties(_Model): + description: Optional[str] + title: Optional[str] + type: Optional[Union[int, DetectorRenderingType]] + + + class azure.mgmt.durabletask.models.DetectorRenderingType(int, Enum, metaclass=CaseInsensitiveEnumMeta): + DATA_SUMMARY = 5 + DYNAMIC_INSIGHT = 8 + EMAIL_SNIPPET = 6 + INSIGHT = 7 + MARKDOWN = 9 + PIE_CHART = 4 + TABLE = 1 + TIME_SERIES_GRAPH = 2 + TIME_SERIES_PER_INSTANCE_GRAPH = 3 + + + class azure.mgmt.durabletask.models.DetectorStatus(_Model): + message: Optional[str] + status_id: Optional[Union[int, DetectorStatusId]] + + + class azure.mgmt.durabletask.models.DetectorStatusId(int, Enum, metaclass=CaseInsensitiveEnumMeta): + CRITICAL = 0 + INFO = 2 + NONE = 4 + SUCCESS = 3 + WARNING = 1 + + + class azure.mgmt.durabletask.models.DetectorTable(_Model): + columns: Optional[list[DetectorTableColumn]] + rows: Optional[list[list[Any]]] + table_name: Optional[str] + + + class azure.mgmt.durabletask.models.DetectorTableColumn(_Model): + column_name: Optional[str] + column_type: Optional[str] + data_type: Optional[str] + + + class azure.mgmt.durabletask.models.DetectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANALYSIS = "Analysis" + CATEGORY_OVERVIEW = "CategoryOverview" + DETECTOR = "Detector" + + + class azure.mgmt.durabletask.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.durabletask.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.durabletask.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverInstance(ProxyResource): + id: str + name: str + properties: Optional[FailoverInstanceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[FailoverInstanceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverInstanceProperties(_Model): + failover_state: Optional[Union[str, FailoverState]] + partner_scheduler_location: Optional[str] + partner_scheduler_resource_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + replication_role: Optional[Union[str, ReplicationRole]] + + @overload + def __init__( + self, + *, + partner_scheduler_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.FailoverState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NONE = "None" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.durabletask.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.durabletask.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.durabletask.models.OptionalPropertiesUpdateableProperties(_Model): + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: Optional[PrivateLinkServiceConnectionState] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.durabletask.models.PrivateEndpoint(_Model): + id: Optional[str] + + + class azure.mgmt.durabletask.models.PrivateEndpointConnection(Resource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateEndpointConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionProperties(_Model): + group_ids: Optional[list[str]] + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Optional[Union[str, PrivateEndpointConnectionProvisioningState]] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: PrivateLinkServiceConnectionState + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate(_Model): + properties: Optional[OptionalPropertiesUpdateableProperties] + + @overload + def __init__( + self, + *, + properties: Optional[OptionalPropertiesUpdateableProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.durabletask.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + required_zone_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[str] + description: Optional[str] + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + + @overload + def __init__( + self, + *, + actions_required: Optional[str] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + PROVISIONING = "Provisioning" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.durabletask.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.durabletask.models.PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.durabletask.models.PurgeableOrchestrationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + COMPLETED = "Completed" + FAILED = "Failed" + TERMINATED = "Terminated" + + + class azure.mgmt.durabletask.models.RedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + ZONE = "Zone" + + + class azure.mgmt.durabletask.models.ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRIMARY = "Primary" + SECONDARY = "Secondary" + + + class azure.mgmt.durabletask.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.durabletask.models.RetentionPolicy(ProxyResource): + id: str + name: str + properties: Optional[RetentionPolicyProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[RetentionPolicyProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.RetentionPolicyDetails(_Model): + orchestration_state: Optional[Union[str, PurgeableOrchestrationState]] + retention_period_in_days: int + + @overload + def __init__( + self, + *, + orchestration_state: Optional[Union[str, PurgeableOrchestrationState]] = ..., + retention_period_in_days: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.RetentionPolicyProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + retention_policies: Optional[list[RetentionPolicyDetails]] + + @overload + def __init__( + self, + *, + retention_policies: Optional[list[RetentionPolicyDetails]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.Scheduler(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[SchedulerProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[SchedulerProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerPrivateLinkResource(Resource): + id: str + name: str + properties: Optional[PrivateLinkResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateLinkResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerProperties(_Model): + endpoint: Optional[str] + ip_allowlist: list[str] + private_endpoint_connections: Optional[list[PrivateEndpointConnection]] + provisioning_state: Optional[Union[str, ProvisioningState]] + public_network_access: Optional[Union[str, PublicNetworkAccess]] + sku: SchedulerSku + + @overload + def __init__( + self, + *, + ip_allowlist: list[str], + public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., + sku: SchedulerSku + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerPropertiesUpdate(_Model): + endpoint: Optional[str] + ip_allowlist: Optional[list[str]] + provisioning_state: Optional[Union[str, ProvisioningState]] + public_network_access: Optional[Union[str, PublicNetworkAccess]] + sku: Optional[SchedulerSkuUpdate] + + @overload + def __init__( + self, + *, + ip_allowlist: Optional[list[str]] = ..., + public_network_access: Optional[Union[str, PublicNetworkAccess]] = ..., + sku: Optional[SchedulerSkuUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerSku(_Model): + capacity: Optional[int] + name: Union[str, SchedulerSkuName] + redundancy_state: Optional[Union[str, RedundancyState]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + name: Union[str, SchedulerSkuName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONSUMPTION = "Consumption" + DEDICATED = "Dedicated" + + + class azure.mgmt.durabletask.models.SchedulerSkuUpdate(_Model): + capacity: Optional[int] + name: Optional[Union[str, SchedulerSkuName]] + redundancy_state: Optional[Union[str, RedundancyState]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + name: Optional[Union[str, SchedulerSkuName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SchedulerUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[SchedulerPropertiesUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[SchedulerPropertiesUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskHub(ProxyResource): + id: str + name: str + properties: Optional[TaskHubProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TaskHubProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskHubProperties(_Model): + capabilities: Optional[list[str]] + dashboard_url: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + capabilities: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueue(ProxyResource): + id: str + name: str + properties: Optional[TaskQueueProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TaskQueueProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + throughput: Optional[TaskQueueThroughput] + + @overload + def __init__( + self, + *, + throughput: Optional[TaskQueueThroughput] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueThroughput(_Model): + actions_per_second: Optional[int] + + @overload + def __init__( + self, + *, + actions_per_second: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TaskQueueUpdate(_Model): + properties: Optional[TaskQueueProperties] + + @overload + def __init__( + self, + *, + properties: Optional[TaskQueueProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TransparentDataEncryption(ProxyResource): + id: str + name: str + properties: Optional[TransparentDataEncryptionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[TransparentDataEncryptionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOMER_MANAGED = "CustomerManaged" + MICROSOFT_MANAGED = "MicrosoftManaged" + + + class azure.mgmt.durabletask.models.TransparentDataEncryptionProperties(_Model): + auto_rotation_enabled: Optional[bool] + key_source: Union[str, TransparentDataEncryptionKeySource] + key_vault_key_uri: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + auto_rotation_enabled: Optional[bool] = ..., + key_source: Union[str, TransparentDataEncryptionKeySource], + key_vault_key_uri: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.durabletask.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + +namespace azure.mgmt.durabletask.operations + + class azure.mgmt.durabletask.operations.DetectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'detector_id', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + detector_id: str, + **kwargs: Any + ) -> Detector: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[Detector]: ... + + + class azure.mgmt.durabletask.operations.FailoverInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def begin_failover( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def begin_force_failover_allow_data_loss( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[FailoverInstance]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> FailoverInstance: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[FailoverInstance]: ... + + + class azure.mgmt.durabletask.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.durabletask.operations.RetentionPoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RetentionPolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> RetentionPolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-04-01-preview', params_added_on={'2025-04-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2025-04-01-preview', '2025-11-01', '2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[RetentionPolicy]: ... + + + class azure.mgmt.durabletask.operations.SchedulersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: Scheduler, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_create_or_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: SchedulerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Scheduler]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PrivateEndpointConnection]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> Scheduler: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_endpoint_connection_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnection: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'private_link_resource_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def get_private_link( + self, + resource_group_name: str, + scheduler_name: str, + private_link_resource_name: str, + **kwargs: Any + ) -> SchedulerPrivateLinkResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Scheduler]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Scheduler]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_endpoint_connections( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[PrivateEndpointConnection]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-02-01', params_added_on={'2026-02-01': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-02-01', '2026-05-01-preview', '2026-07-01-preview']) + def list_private_links( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[SchedulerPrivateLinkResource]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def restart( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> None: ... + + + class azure.mgmt.durabletask.operations.TaskHubsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskHub]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> TaskHub: ... + + @distributed_trace + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[TaskHub]: ... + + + class azure.mgmt.durabletask.operations.TaskQueuesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name']}, api_versions_list=['2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TaskQueue]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'task_queue_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + **kwargs: Any + ) -> TaskQueue: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-07-01-preview', params_added_on={'2026-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'task_hub_name', 'accept']}, api_versions_list=['2026-07-01-preview']) + def list_by_task_hub( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + **kwargs: Any + ) -> ItemPaged[TaskQueue]: ... + + + class azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[TransparentDataEncryption]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def begin_delete( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def get( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> TransparentDataEncryption: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'scheduler_name', 'accept']}, api_versions_list=['2026-05-01-preview', '2026-07-01-preview']) + def list_by_scheduler( + self, + resource_group_name: str, + scheduler_name: str, + **kwargs: Any + ) -> ItemPaged[TransparentDataEncryption]: ... + + +namespace azure.mgmt.durabletask.types + + class azure.mgmt.durabletask.types.FailoverInstance(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('FailoverInstanceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: FailoverInstanceProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.FailoverInstanceProperties(TypedDict, total=False): + key "failoverState": Union[str, FailoverState] + key "partnerSchedulerLocation": str + key "partnerSchedulerResourceId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "replicationRole": Union[str, ReplicationRole] + failoverState: Union[str, FailoverState] + partnerSchedulerLocation: str + partnerSchedulerResourceId: str + provisioningState: Union[str, ProvisioningState] + replicationRole: Union[str, ReplicationRole] + + + class azure.mgmt.durabletask.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.durabletask.types.OptionalPropertiesUpdateableProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": ForwardRef('PrivateLinkServiceConnectionState', module='types') + privateEndpoint: PrivateEndpoint + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState + + + class azure.mgmt.durabletask.types.PrivateEndpoint(TypedDict, total=False): + key "id": str + id: str + + + class azure.mgmt.durabletask.types.PrivateEndpointConnection(Resource): + key "id": str + key "name": str + key "properties": ForwardRef('PrivateEndpointConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PrivateEndpointConnectionProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.PrivateEndpointConnectionProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": Required[PrivateLinkServiceConnectionState] + key "provisioningState": Union[str, PrivateEndpointConnectionProvisioningState] + groupIds: list[str] + privateEndpoint: PrivateEndpoint + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState + provisioningState: Union[str, PrivateEndpointConnectionProvisioningState] + + + class azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate(TypedDict, total=False): + key "properties": ForwardRef('OptionalPropertiesUpdateableProperties', module='types') + properties: OptionalPropertiesUpdateableProperties + + + class azure.mgmt.durabletask.types.PrivateLinkServiceConnectionState(TypedDict, total=False): + key "actionsRequired": str + key "description": str + key "status": Union[str, PrivateEndpointServiceConnectionStatus] + actionsRequired: str + description: str + status: Union[str, PrivateEndpointServiceConnectionStatus] + + + class azure.mgmt.durabletask.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.RetentionPolicy(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('RetentionPolicyProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: RetentionPolicyProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.RetentionPolicyDetails(TypedDict, total=False): + key "orchestrationState": Union[str, PurgeableOrchestrationState] + key "retentionPeriodInDays": Required[int] + orchestrationState: Union[str, PurgeableOrchestrationState] + retentionPeriodInDays: int + + + class azure.mgmt.durabletask.types.RetentionPolicyProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + provisioningState: Union[str, ProvisioningState] + retentionPolicies: list[RetentionPolicyDetails] + + + class azure.mgmt.durabletask.types.Scheduler(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('SchedulerProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: SchedulerProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.durabletask.types.SchedulerProperties(TypedDict, total=False): + key "endpoint": str + key "ipAllowlist": Required[list[str]] + key "provisioningState": Union[str, ProvisioningState] + key "publicNetworkAccess": Union[str, PublicNetworkAccess] + key "sku": Required[SchedulerSku] + endpoint: str + ipAllowlist: list[str] + privateEndpointConnections: list[PrivateEndpointConnection] + provisioningState: Union[str, ProvisioningState] + publicNetworkAccess: Union[str, PublicNetworkAccess] + sku: SchedulerSku + + + class azure.mgmt.durabletask.types.SchedulerPropertiesUpdate(TypedDict, total=False): + key "endpoint": str + key "provisioningState": Union[str, ProvisioningState] + key "publicNetworkAccess": Union[str, PublicNetworkAccess] + key "sku": ForwardRef('SchedulerSkuUpdate', module='types') + endpoint: str + ipAllowlist: list[str] + provisioningState: Union[str, ProvisioningState] + publicNetworkAccess: Union[str, PublicNetworkAccess] + sku: SchedulerSkuUpdate + + + class azure.mgmt.durabletask.types.SchedulerSku(TypedDict, total=False): + key "capacity": int + key "name": Required[Union[str, SchedulerSkuName]] + key "redundancyState": Union[str, RedundancyState] + capacity: int + name: Union[str, SchedulerSkuName] + redundancyState: Union[str, RedundancyState] + + + class azure.mgmt.durabletask.types.SchedulerSkuUpdate(TypedDict, total=False): + key "capacity": int + key "name": Union[str, SchedulerSkuName] + key "redundancyState": Union[str, RedundancyState] + capacity: int + name: Union[str, SchedulerSkuName] + redundancyState: Union[str, RedundancyState] + + + class azure.mgmt.durabletask.types.SchedulerUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('SchedulerPropertiesUpdate', module='types') + identity: ManagedServiceIdentity + properties: SchedulerPropertiesUpdate + tags: dict[str, str] + + + class azure.mgmt.durabletask.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.durabletask.types.TaskHub(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TaskHubProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TaskHubProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TaskHubProperties(TypedDict, total=False): + key "dashboardUrl": str + key "provisioningState": Union[str, ProvisioningState] + capabilities: list[str] + dashboardUrl: str + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.durabletask.types.TaskQueue(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TaskQueueProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TaskQueueProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TaskQueueProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + key "throughput": ForwardRef('TaskQueueThroughput', module='types') + provisioningState: Union[str, ProvisioningState] + throughput: TaskQueueThroughput + + + class azure.mgmt.durabletask.types.TaskQueueThroughput(TypedDict, total=False): + key "actionsPerSecond": int + actionsPerSecond: int + + + class azure.mgmt.durabletask.types.TaskQueueUpdate(TypedDict, total=False): + key "properties": ForwardRef('TaskQueueProperties', module='types') + properties: TaskQueueProperties + + + class azure.mgmt.durabletask.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.durabletask.types.TransparentDataEncryption(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('TransparentDataEncryptionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: TransparentDataEncryptionProperties + systemData: SystemData + type: str + + + class azure.mgmt.durabletask.types.TransparentDataEncryptionProperties(TypedDict, total=False): + key "autoRotationEnabled": bool + key "keySource": Required[Union[str, TransparentDataEncryptionKeySource]] + key "keyVaultKeyUri": str + key "provisioningState": Union[str, ProvisioningState] + autoRotationEnabled: bool + keySource: Union[str, TransparentDataEncryptionKeySource] + keyVaultKeyUri: str + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.durabletask.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + +``` \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml b/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml new file mode 100644 index 000000000000..a334e84b75fc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: 37226e58cfa0e1a3b7bd1f41554efd66701d1e0f7b3ab541fd24dad8331f74a1 +packageVersion: 1.2.0b1 +parserVersion: 0.3.31 +pythonVersion: 3.13.16 diff --git a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json index 529451e3fd12..3353f4127e8f 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json +++ b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json @@ -1,20 +1,31 @@ { "CrossLanguagePackageId": "Microsoft.DurableTask", "CrossLanguageDefinitionId": { + "azure.mgmt.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.durabletask.models.Detector": "Microsoft.DurableTask.Detector", + "azure.mgmt.durabletask.models.DetectorDataset": "Microsoft.DurableTask.DetectorDataset", + "azure.mgmt.durabletask.models.DetectorMetadata": "Microsoft.DurableTask.DetectorMetadata", + "azure.mgmt.durabletask.models.DetectorProperties": "Microsoft.DurableTask.DetectorProperties", + "azure.mgmt.durabletask.models.DetectorRenderingProperties": "Microsoft.DurableTask.DetectorRenderingProperties", + "azure.mgmt.durabletask.models.DetectorStatus": "Microsoft.DurableTask.DetectorStatus", + "azure.mgmt.durabletask.models.DetectorTable": "Microsoft.DurableTask.DetectorTable", + "azure.mgmt.durabletask.models.DetectorTableColumn": "Microsoft.DurableTask.DetectorTableColumn", "azure.mgmt.durabletask.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.durabletask.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.durabletask.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.durabletask.models.FailoverInstance": "Microsoft.DurableTask.FailoverInstance", + "azure.mgmt.durabletask.models.FailoverInstanceProperties": "Microsoft.DurableTask.FailoverInstanceProperties", + "azure.mgmt.durabletask.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "azure.mgmt.durabletask.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.durabletask.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.durabletask.models.OptionalPropertiesUpdateableProperties": "TypeSpec.OptionalProperties", "azure.mgmt.durabletask.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", - "azure.mgmt.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.durabletask.models.PrivateEndpointConnection": "Microsoft.DurableTask.PrivateEndpointConnection", "azure.mgmt.durabletask.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", "azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate": "Azure.ResourceManager.PrivateEndpointConnectionUpdate", "azure.mgmt.durabletask.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "azure.mgmt.durabletask.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", - "azure.mgmt.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.durabletask.models.RetentionPolicy": "Microsoft.DurableTask.RetentionPolicy", "azure.mgmt.durabletask.models.RetentionPolicyDetails": "Microsoft.DurableTask.RetentionPolicyDetails", "azure.mgmt.durabletask.models.RetentionPolicyProperties": "Microsoft.DurableTask.RetentionPolicyProperties", @@ -29,18 +40,36 @@ "azure.mgmt.durabletask.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.durabletask.models.TaskHub": "Microsoft.DurableTask.TaskHub", "azure.mgmt.durabletask.models.TaskHubProperties": "Microsoft.DurableTask.TaskHubProperties", + "azure.mgmt.durabletask.models.TaskQueue": "Microsoft.DurableTask.TaskQueue", + "azure.mgmt.durabletask.models.TaskQueueProperties": "Microsoft.DurableTask.TaskQueueProperties", + "azure.mgmt.durabletask.models.TaskQueueThroughput": "Microsoft.DurableTask.TaskQueueThroughput", + "azure.mgmt.durabletask.models.TaskQueueUpdate": "Microsoft.DurableTask.TaskQueueUpdate", + "azure.mgmt.durabletask.models.TransparentDataEncryption": "Microsoft.DurableTask.TransparentDataEncryption", + "azure.mgmt.durabletask.models.TransparentDataEncryptionProperties": "Microsoft.DurableTask.TransparentDataEncryptionProperties", + "azure.mgmt.durabletask.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.durabletask.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.durabletask.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.durabletask.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", "azure.mgmt.durabletask.models.ProvisioningState": "Microsoft.DurableTask.ProvisioningState", + "azure.mgmt.durabletask.models.DetectorType": "Microsoft.DurableTask.DetectorType", + "azure.mgmt.durabletask.models.DetectorRenderingType": "Microsoft.DurableTask.DetectorRenderingType", + "azure.mgmt.durabletask.models.DetectorStatusId": "Microsoft.DurableTask.DetectorStatusId", "azure.mgmt.durabletask.models.SchedulerSkuName": "Microsoft.DurableTask.SchedulerSkuName", "azure.mgmt.durabletask.models.RedundancyState": "Microsoft.DurableTask.RedundancyState", "azure.mgmt.durabletask.models.PublicNetworkAccess": "Microsoft.DurableTask.PublicNetworkAccess", "azure.mgmt.durabletask.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", "azure.mgmt.durabletask.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.durabletask.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.durabletask.models.PurgeableOrchestrationState": "Microsoft.DurableTask.PurgeableOrchestrationState", + "azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource": "Microsoft.DurableTask.TransparentDataEncryptionKeySource", + "azure.mgmt.durabletask.models.ReplicationRole": "Microsoft.DurableTask.ReplicationRole", + "azure.mgmt.durabletask.models.FailoverState": "Microsoft.DurableTask.FailoverState", "azure.mgmt.durabletask.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.durabletask.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.durabletask.operations.DetectorsOperations.get": "Microsoft.DurableTask.Detectors.get", + "azure.mgmt.durabletask.aio.operations.DetectorsOperations.get": "Microsoft.DurableTask.Detectors.get", + "azure.mgmt.durabletask.operations.DetectorsOperations.list_by_scheduler": "Microsoft.DurableTask.Detectors.listByScheduler", + "azure.mgmt.durabletask.aio.operations.DetectorsOperations.list_by_scheduler": "Microsoft.DurableTask.Detectors.listByScheduler", "azure.mgmt.durabletask.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get", "azure.mgmt.durabletask.aio.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get", "azure.mgmt.durabletask.operations.SchedulersOperations.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate", @@ -67,6 +96,8 @@ "azure.mgmt.durabletask.aio.operations.SchedulersOperations.begin_delete_private_endpoint_connection": "Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection", "azure.mgmt.durabletask.operations.SchedulersOperations.list_private_endpoint_connections": "Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections", "azure.mgmt.durabletask.aio.operations.SchedulersOperations.list_private_endpoint_connections": "Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections", + "azure.mgmt.durabletask.operations.SchedulersOperations.restart": "Microsoft.DurableTask.Schedulers.restart", + "azure.mgmt.durabletask.aio.operations.SchedulersOperations.restart": "Microsoft.DurableTask.Schedulers.restart", "azure.mgmt.durabletask.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get", "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get", "azure.mgmt.durabletask.operations.TaskHubsOperations.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate", @@ -75,6 +106,16 @@ "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.begin_delete": "Microsoft.DurableTask.TaskHubs.delete", "azure.mgmt.durabletask.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler", "azure.mgmt.durabletask.aio.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.get": "Microsoft.DurableTask.TaskQueues.get", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.get": "Microsoft.DurableTask.TaskQueues.get", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_create_or_update": "Microsoft.DurableTask.TaskQueues.createOrUpdate", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_create_or_update": "Microsoft.DurableTask.TaskQueues.createOrUpdate", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_update": "Microsoft.DurableTask.TaskQueues.update", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_update": "Microsoft.DurableTask.TaskQueues.update", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.begin_delete": "Microsoft.DurableTask.TaskQueues.delete", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.begin_delete": "Microsoft.DurableTask.TaskQueues.delete", + "azure.mgmt.durabletask.operations.TaskQueuesOperations.list_by_task_hub": "Microsoft.DurableTask.TaskQueues.listByTaskHub", + "azure.mgmt.durabletask.aio.operations.TaskQueuesOperations.list_by_task_hub": "Microsoft.DurableTask.TaskQueues.listByTaskHub", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get", "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace", @@ -84,6 +125,27 @@ "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete", "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete", "azure.mgmt.durabletask.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler", - "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler" - } + "azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.get": "Microsoft.DurableTask.TransparentDataEncryptions.get", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.get": "Microsoft.DurableTask.TransparentDataEncryptions.get", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.begin_create_or_replace": "Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_replace": "Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.begin_delete": "Microsoft.DurableTask.TransparentDataEncryptions.delete", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.begin_delete": "Microsoft.DurableTask.TransparentDataEncryptions.delete", + "azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations.list_by_scheduler": "Microsoft.DurableTask.TransparentDataEncryptions.listByScheduler", + "azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations.list_by_scheduler": "Microsoft.DurableTask.TransparentDataEncryptions.listByScheduler", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.get": "Microsoft.DurableTask.FailoverInstances.get", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.get": "Microsoft.DurableTask.FailoverInstances.get", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_create_or_replace": "Microsoft.DurableTask.FailoverInstances.createOrReplace", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_create_or_replace": "Microsoft.DurableTask.FailoverInstances.createOrReplace", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_delete": "Microsoft.DurableTask.FailoverInstances.delete", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_delete": "Microsoft.DurableTask.FailoverInstances.delete", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.list_by_scheduler": "Microsoft.DurableTask.FailoverInstances.listByScheduler", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.list_by_scheduler": "Microsoft.DurableTask.FailoverInstances.listByScheduler", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_failover": "Microsoft.DurableTask.FailoverInstances.failover", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_failover": "Microsoft.DurableTask.FailoverInstances.failover", + "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss", + "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss" + }, + "CrossLanguageVersion": "cbc588f0f984" } \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py index 0fd9b1d201e6..a1580cb336f1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -19,24 +19,47 @@ from ._configuration import DurableTaskMgmtClientConfiguration from ._utils.serialization import Deserializer, Serializer -from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations +from .operations import ( + DetectorsOperations, + FailoverInstancesOperations, + Operations, + RetentionPoliciesOperations, + SchedulersOperations, + TaskHubsOperations, + TaskQueuesOperations, + TransparentDataEncryptionsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class DurableTaskMgmtClient: +class DurableTaskMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """DurableTaskMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.durabletask.operations.Operations + :ivar detectors: DetectorsOperations operations + :vartype detectors: azure.mgmt.durabletask.operations.DetectorsOperations :ivar schedulers: SchedulersOperations operations :vartype schedulers: azure.mgmt.durabletask.operations.SchedulersOperations :ivar task_hubs: TaskHubsOperations operations :vartype task_hubs: azure.mgmt.durabletask.operations.TaskHubsOperations + :ivar task_queues: TaskQueuesOperations operations + :vartype task_queues: azure.mgmt.durabletask.operations.TaskQueuesOperations :ivar retention_policies: RetentionPoliciesOperations operations :vartype retention_policies: azure.mgmt.durabletask.operations.RetentionPoliciesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.durabletask.operations.TransparentDataEncryptionsOperations + :ivar failover_instances: FailoverInstancesOperations operations + :vartype failover_instances: azure.mgmt.durabletask.operations.FailoverInstancesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -46,9 +69,10 @@ class DurableTaskMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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. @@ -102,11 +126,19 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.detectors = DetectorsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedulers = SchedulersOperations(self._client, self._config, self._serialize, self._deserialize) self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_queues = TaskQueuesOperations(self._client, self._config, self._serialize, self._deserialize) self.retention_policies = RetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_instances = FailoverInstancesOperations( + 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/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py index c3cb9d9052ef..c42eaedef1e1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DurableTaskMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,10 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-02-01") + api_version: str = kwargs.pop("api_version", "2026-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py @@ -8,7 +8,6 @@ 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 diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py index b4433021b4e5..35d5fc024978 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -130,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -296,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -308,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -325,12 +373,18 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -420,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,59 +883,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -664,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -690,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -718,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -891,6 +1242,8 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore @@ -1049,6 +1402,7 @@ def _failsafe_deserialize_xml( return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -1061,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1068,10 +1423,12 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1091,7 +1448,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1104,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1150,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1159,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1183,6 +1549,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1194,10 +1610,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1219,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1231,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1245,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1252,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1261,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1279,8 +1702,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None 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 + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1301,11 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1316,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py index 81ec1de5922b..ae08f9d89f74 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -476,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -516,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py index ed0855dea5e6..5bf479b145f7 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.2.0b1" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py index c8a870228efa..9ed283cdf0fd 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -19,24 +19,47 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import DurableTaskMgmtClientConfiguration -from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations +from .operations import ( + DetectorsOperations, + FailoverInstancesOperations, + Operations, + RetentionPoliciesOperations, + SchedulersOperations, + TaskHubsOperations, + TaskQueuesOperations, + TransparentDataEncryptionsOperations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class DurableTaskMgmtClient: +class DurableTaskMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """DurableTaskMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.durabletask.aio.operations.Operations + :ivar detectors: DetectorsOperations operations + :vartype detectors: azure.mgmt.durabletask.aio.operations.DetectorsOperations :ivar schedulers: SchedulersOperations operations :vartype schedulers: azure.mgmt.durabletask.aio.operations.SchedulersOperations :ivar task_hubs: TaskHubsOperations operations :vartype task_hubs: azure.mgmt.durabletask.aio.operations.TaskHubsOperations + :ivar task_queues: TaskQueuesOperations operations + :vartype task_queues: azure.mgmt.durabletask.aio.operations.TaskQueuesOperations :ivar retention_policies: RetentionPoliciesOperations operations :vartype retention_policies: azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.durabletask.aio.operations.TransparentDataEncryptionsOperations + :ivar failover_instances: FailoverInstancesOperations operations + :vartype failover_instances: azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -46,9 +69,10 @@ class DurableTaskMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. 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. @@ -104,11 +128,19 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.detectors = DetectorsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedulers = SchedulersOperations(self._client, self._config, self._serialize, self._deserialize) self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize) + self.task_queues = TaskQueuesOperations(self._client, self._config, self._serialize, self._deserialize) self.retention_policies = RetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_instances = FailoverInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py index 5e2132b7f447..27b5ced74578 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DurableTaskMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,10 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2026-02-01" - and None. Default value is "2026-02-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-07-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-02-01") + api_version: str = kwargs.pop("api_version", "2026-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/_patch.py @@ -8,7 +8,6 @@ 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 diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py index 18dc884c6cc0..2c8eaa1bc1f9 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/__init__.py @@ -13,9 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import DetectorsOperations # type: ignore from ._operations import SchedulersOperations # type: ignore from ._operations import TaskHubsOperations # type: ignore +from ._operations import TaskQueuesOperations # type: ignore from ._operations import RetentionPoliciesOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import FailoverInstancesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -23,9 +27,13 @@ __all__ = [ "Operations", + "DetectorsOperations", "SchedulersOperations", "TaskHubsOperations", + "TaskQueuesOperations", "RetentionPoliciesOperations", + "TransparentDataEncryptionsOperations", + "FailoverInstancesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py index 37fea430dd4a..3540d35ccc12 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_operations.py @@ -33,11 +33,19 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation from ...operations._operations import ( + build_detectors_get_request, + build_detectors_list_by_scheduler_request, + build_failover_instances_create_or_replace_request, + build_failover_instances_delete_request, + build_failover_instances_failover_request, + build_failover_instances_force_failover_allow_data_loss_request, + build_failover_instances_get_request, + build_failover_instances_list_by_scheduler_request, build_operations_list_request, build_retention_policies_create_or_replace_request, build_retention_policies_delete_request, @@ -55,22 +63,31 @@ build_schedulers_list_by_subscription_request, build_schedulers_list_private_endpoint_connections_request, build_schedulers_list_private_links_request, + build_schedulers_restart_request, build_schedulers_update_private_endpoint_connection_request, build_schedulers_update_request, build_task_hubs_create_or_update_request, build_task_hubs_delete_request, build_task_hubs_get_request, build_task_hubs_list_by_scheduler_request, + build_task_queues_create_or_update_request, + build_task_queues_delete_request, + build_task_queues_get_request, + build_task_queues_list_by_task_hub_request, + build_task_queues_update_request, + build_transparent_data_encryptions_create_or_replace_request, + build_transparent_data_encryptions_delete_request, + build_transparent_data_encryptions_get_request, + build_transparent_data_encryptions_list_by_scheduler_request, ) from .._configuration import DurableTaskMgmtClientConfiguration T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -134,7 +151,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -177,7 +197,223 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SchedulersOperations: +class DetectorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`detectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "detector_id", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def get( + self, resource_group_name: str, scheduler_name: str, detector_id: str, **kwargs: Any + ) -> _models.Detector: + """Gets a diagnostic detector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param detector_id: The name of the Detector. Required. + :type detector_id: str + :return: Detector. The Detector is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.Detector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Detector] = kwargs.pop("cls", None) + + _request = build_detectors_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + detector_id=detector_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Detector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Detector"]: + """Lists the diagnostic detectors belonging to a scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of Detector + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.Detector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Detector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_detectors_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Detector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SchedulersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -268,7 +504,7 @@ async def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -374,7 +610,7 @@ async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.Scheduler, *, content_type: str = "application/json", **kwargs: Any @@ -387,7 +623,7 @@ async def begin_create_or_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.Scheduler :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -430,7 +666,7 @@ async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Scheduler]: """Create or update a Scheduler. @@ -440,9 +676,10 @@ async def begin_create_or_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: Scheduler, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.Scheduler or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scheduler type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Scheduler or + ~azure.mgmt.durabletask.types.Scheduler or IO[bytes] :return: An instance of AsyncLROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -504,7 +741,7 @@ async def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -608,7 +845,7 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + properties: _types.SchedulerUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -621,7 +858,7 @@ async def begin_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.SchedulerUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -664,7 +901,7 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Scheduler]: """Update a Scheduler. @@ -674,9 +911,10 @@ async def begin_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchedulerUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a SchedulerUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or + ~azure.mgmt.durabletask.types.SchedulerUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -904,7 +1142,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -994,7 +1235,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1049,7 +1293,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def get_private_link( self, resource_group_name: str, scheduler_name: str, private_link_resource_name: str, **kwargs: Any @@ -1133,7 +1377,7 @@ async def get_private_link( params_added_on={ "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def list_private_links( self, resource_group_name: str, scheduler_name: str, **kwargs: Any @@ -1192,7 +1436,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1247,7 +1494,7 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def get_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -1338,14 +1585,14 @@ async def get_private_endpoint_connection( "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1458,7 +1705,7 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: JSON, + resource: _types.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any @@ -1474,7 +1721,7 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable with the Azure resource. Required. :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1532,14 +1779,14 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: """Create or update a private endpoint connection for the durable task scheduler. @@ -1552,9 +1799,10 @@ async def begin_create_or_update_private_endpoint_connection( # pylint: disable :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PrivateEndpointConnection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or + ~azure.mgmt.durabletask.types.PrivateEndpointConnection or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The PrivateEndpointConnection is compatible with MutableMapping :rtype: @@ -1627,14 +1875,14 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1745,7 +1993,7 @@ async def begin_update_private_endpoint_connection( resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: JSON, + properties: _types.PrivateEndpointConnectionUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1761,7 +2009,7 @@ async def begin_update_private_endpoint_connection( with the Azure resource. Required. :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1819,14 +2067,14 @@ async def begin_update_private_endpoint_connection( "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_update_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: """Update a private endpoint connection for the durable task scheduler. @@ -1839,10 +2087,10 @@ async def begin_update_private_endpoint_connection( :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PrivateEndpointConnectionUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or + ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The PrivateEndpointConnection is compatible with MutableMapping :rtype: @@ -1913,7 +2161,7 @@ def get_long_running_output(pipeline_response): "private_endpoint_connection_name", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -1989,7 +2237,7 @@ async def _delete_private_endpoint_connection_initial( # pylint: disable=name-t "private_endpoint_connection_name", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) async def begin_delete_private_endpoint_connection( self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -2059,7 +2307,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def list_private_endpoint_connections( self, resource_group_name: str, scheduler_name: str, **kwargs: Any @@ -2118,7 +2366,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2160,8 +2411,72 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def restart(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> None: + """Restart a Scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_schedulers_restart_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore -class TaskHubsOperations: + +class TaskHubsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2258,7 +2573,7 @@ async def _create_or_update_initial( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2369,7 +2684,7 @@ async def begin_create_or_update( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: JSON, + resource: _types.TaskHub, *, content_type: str = "application/json", **kwargs: Any @@ -2384,7 +2699,7 @@ async def begin_create_or_update( :param task_hub_name: The name of the TaskHub. Required. :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TaskHub :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2431,7 +2746,7 @@ async def begin_create_or_update( resource_group_name: str, scheduler_name: str, task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.TaskHub]: """Create or Update a Task Hub. @@ -2443,9 +2758,10 @@ async def begin_create_or_update( :type scheduler_name: str :param task_hub_name: The name of the TaskHub. Required. :type task_hub_name: str - :param resource: Resource create parameters. Is one of the following types: TaskHub, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or ~azure.mgmt.durabletask.types.TaskHub + or IO[bytes] :return: An instance of AsyncLROPoller that returns TaskHub. The TaskHub is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskHub] @@ -2685,7 +3001,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2728,14 +3047,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class RetentionPoliciesOperations: +class TaskQueuesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s - :attr:`retention_policies` attribute. + :attr:`task_queues` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2747,22 +3066,36 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "accept", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: - """Get a Retention Policy. + async def get( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> _models.TaskQueue: + """Get a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: TaskQueue. The TaskQueue is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2776,11 +3109,13 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) - _request = build_retention_policies_get_request( + _request = build_task_queues_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2815,7 +3150,7 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2823,24 +3158,28 @@ async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any return deserialized # type: ignore @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def _create_or_replace_initial( + async def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2864,9 +3203,11 @@ async def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_create_or_replace_request( + _request = build_task_queues_create_or_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2914,138 +3255,167 @@ async def _create_or_replace_initial( return deserialized # type: ignore @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: _models.RetentionPolicy, + task_hub_name: str, + task_queue_name: str, + resource: _models.TaskQueue, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :type resource: ~azure.mgmt.durabletask.models.TaskQueue :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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + task_hub_name: str, + task_queue_name: str, + resource: _types.TaskQueue, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TaskQueue :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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, + task_hub_name: str, + task_queue_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param resource: Resource create parameters. Required. :type resource: 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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def begin_create_or_replace( + async def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Create or update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: RetentionPolicy, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Is either a TaskQueue type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue or + ~azure.mgmt.durabletask.types.TaskQueue or IO[bytes] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :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.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = 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: - raw_result = await self._create_or_replace_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3058,7 +3428,7 @@ async def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3076,35 +3446,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + return AsyncLROPoller[_models.TaskQueue].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.RetentionPolicy]( + return AsyncLROPoller[_models.TaskQueue]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3128,9 +3502,11 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_update_request( + _request = build_task_queues_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3180,26 +3556,32 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: _models.RetentionPolicy, + task_hub_name: str, + task_queue_name: str, + properties: _models.TaskQueueUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate :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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3208,26 +3590,32 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + task_hub_name: str, + task_queue_name: str, + properties: _types.TaskQueueUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.TaskQueueUpdate :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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3236,71 +3624,86 @@ async def begin_update( self, resource_group_name: str, scheduler_name: str, + task_hub_name: str, + task_queue_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :param properties: The resource properties to be updated. Required. :type properties: 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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", + "task_hub_name", + "task_queue_name", "content_type", "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + ) -> AsyncLROPoller[_models.TaskQueue]: + """Update a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - RetentionPolicy, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Is either a TaskQueueUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate or + ~azure.mgmt.durabletask.types.TaskQueueUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TaskQueue] :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.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.TaskQueue] = 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) @@ -3308,6 +3711,8 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -3320,7 +3725,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.TaskQueue, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3338,25 +3743,32 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + return AsyncLROPoller[_models.TaskQueue].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.RetentionPolicy]( + return AsyncLROPoller[_models.TaskQueue]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) async def _delete_initial( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3371,9 +3783,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_retention_policies_delete_request( + _request = build_task_queues_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3418,20 +3832,33 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Retention Policy. + async def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Task Queue. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3447,6 +3874,8 @@ async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kw raw_result = await self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3482,30 +3911,39 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "accept", + ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def list_by_scheduler( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RetentionPolicy"]: - """List Retention Policies. + def list_by_task_hub( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.TaskQueue"]: + """List Task Queues by Task Hub. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of RetentionPolicy - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An iterator like instance of TaskQueue + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TaskQueue]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3518,9 +3956,10 @@ def list_by_scheduler( def prepare_request(next_link=None): if not next_link: - _request = build_retention_policies_list_by_scheduler_request( + _request = build_task_queues_list_by_task_hub_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3544,7 +3983,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3558,7 +4000,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.RetentionPolicy], + List[_models.TaskQueue], deserialized.get("value", []), ) if cls: @@ -3585,3 +4027,2406 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) + + +class RetentionPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: + """Get a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + + _request = build_retention_policies_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_retention_policies_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.RetentionPolicy + :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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a RetentionPolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :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.RetentionPolicy] = 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: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _update_initial( + self, + resource_group_name: str, + scheduler_name: str, + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_retention_policies_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: _models.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy + :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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: _types.RetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.RetentionPolicy + :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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param properties: The resource properties to be updated. Is either a RetentionPolicy type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :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.RetentionPolicy] = 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: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + properties=properties, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_retention_policies_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Retention Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_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) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-04-01-preview", + params_added_on={ + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RetentionPolicy"]: + """List Retention Policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of RetentionPolicy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_retention_policies_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TransparentDataEncryptionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`transparent_data_encryptions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def get( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> _models.TransparentDataEncryption: + """Get a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: TransparentDataEncryption. The TransparentDataEncryption is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_transparent_data_encryptions_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption + :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 TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.TransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TransparentDataEncryption + :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 TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a TransparentDataEncryption type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption or + ~azure.mgmt.durabletask.types.TransparentDataEncryption or IO[bytes] + :return: An instance of AsyncLROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :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.TransparentDataEncryption] = 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: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Transparent Data Encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_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) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.TransparentDataEncryption"]: + """List Transparent Data Encryptions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of TransparentDataEncryption + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.TransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TransparentDataEncryption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_transparent_data_encryptions_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TransparentDataEncryption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FailoverInstancesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.aio.DurableTaskMgmtClient`'s + :attr:`failover_instances` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.FailoverInstance: + """Get a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: FailoverInstance. The FailoverInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.FailoverInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) + + _request = build_failover_instances_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FailoverInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_instances_create_or_replace_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _models.FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance + :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 FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: _types.FailoverInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.FailoverInstance + :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 FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + scheduler_name: str, + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param resource: Resource create parameters. Is either a FailoverInstance type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance or + ~azure.mgmt.durabletask.types.FailoverInstance or IO[bytes] + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :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.FailoverInstance] = 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: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_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) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FailoverInstance"]: + """List Failover Instances. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of FailoverInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_instances_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _failover_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_failover_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_failover( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Trigger a graceful failover for the parent scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = 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: + raw_result = await self._failover_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + async def begin_force_failover_allow_data_loss( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverInstance]: + """Trigger a forced failover with potential data loss for the parent scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of AsyncLROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverInstance] = 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: + raw_result = await self._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/aio/operations/_patch.py @@ -8,7 +8,6 @@ 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 diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py index 5dc55ea84dcc..bd918bd0fbb8 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/__init__.py @@ -14,9 +14,20 @@ from ._models import ( # type: ignore + Detector, + DetectorDataset, + DetectorMetadata, + DetectorProperties, + DetectorRenderingProperties, + DetectorStatus, + DetectorTable, + DetectorTableColumn, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, + FailoverInstance, + FailoverInstanceProperties, + ManagedServiceIdentity, Operation, OperationDisplay, OptionalPropertiesUpdateableProperties, @@ -41,12 +52,24 @@ SystemData, TaskHub, TaskHubProperties, + TaskQueue, + TaskQueueProperties, + TaskQueueThroughput, + TaskQueueUpdate, TrackedResource, + TransparentDataEncryption, + TransparentDataEncryptionProperties, + UserAssignedIdentity, ) from ._enums import ( # type: ignore ActionType, CreatedByType, + DetectorRenderingType, + DetectorStatusId, + DetectorType, + FailoverState, + ManagedServiceIdentityType, Origin, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, @@ -54,16 +77,29 @@ PublicNetworkAccess, PurgeableOrchestrationState, RedundancyState, + ReplicationRole, SchedulerSkuName, + TransparentDataEncryptionKeySource, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Detector", + "DetectorDataset", + "DetectorMetadata", + "DetectorProperties", + "DetectorRenderingProperties", + "DetectorStatus", + "DetectorTable", + "DetectorTableColumn", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "FailoverInstance", + "FailoverInstanceProperties", + "ManagedServiceIdentity", "Operation", "OperationDisplay", "OptionalPropertiesUpdateableProperties", @@ -88,9 +124,21 @@ "SystemData", "TaskHub", "TaskHubProperties", + "TaskQueue", + "TaskQueueProperties", + "TaskQueueThroughput", + "TaskQueueUpdate", "TrackedResource", + "TransparentDataEncryption", + "TransparentDataEncryptionProperties", + "UserAssignedIdentity", "ActionType", "CreatedByType", + "DetectorRenderingType", + "DetectorStatusId", + "DetectorType", + "FailoverState", + "ManagedServiceIdentityType", "Origin", "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", @@ -98,7 +146,9 @@ "PublicNetworkAccess", "PurgeableOrchestrationState", "RedundancyState", + "ReplicationRole", "SchedulerSkuName", + "TransparentDataEncryptionKeySource", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py index 7ef293ceac02..331f19e1b1dc 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_enums.py @@ -11,7 +11,7 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. """ @@ -32,9 +32,86 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class DetectorRenderingType(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The rendering type for a detector dataset.""" + + TABLE = 1 + """A table rendering.""" + TIME_SERIES_GRAPH = 2 + """A time series graph rendering.""" + TIME_SERIES_PER_INSTANCE_GRAPH = 3 + """A time series per-instance graph rendering.""" + PIE_CHART = 4 + """A pie chart rendering.""" + DATA_SUMMARY = 5 + """A data summary rendering.""" + EMAIL_SNIPPET = 6 + """An email snippet rendering.""" + INSIGHT = 7 + """An insight rendering.""" + DYNAMIC_INSIGHT = 8 + """A dynamic insight rendering.""" + MARKDOWN = 9 + """A Markdown rendering.""" + + +class DetectorStatusId(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a detector result.""" + + CRITICAL = 0 + """A critical issue was detected.""" + WARNING = 1 + """A warning was detected.""" + INFO = 2 + """An informational result was returned.""" + SUCCESS = 3 + """The detector completed without detecting an issue.""" + NONE = 4 + """The detector did not run or returned no insights.""" + + +class DetectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of diagnostic response.""" + + DETECTOR = "Detector" + """A diagnostic detector.""" + ANALYSIS = "Analysis" + """A diagnostic analysis.""" + CATEGORY_OVERVIEW = "CategoryOverview" + """A diagnostic category overview.""" + + +class FailoverState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current state of the failover operation.""" + + NONE = "None" + """No failover operation is active.""" + IN_PROGRESS = "InProgress" + """The failover operation is in progress.""" + SUCCEEDED = "Succeeded" + """The failover operation completed successfully.""" + FAILED = "Failed" + """The failover operation failed.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". + logs UX. Default value is \"user,system\". """ USER = "user" @@ -121,6 +198,15 @@ class RedundancyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The resource is zone redundant.""" +class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The replication role of the scheduler.""" + + PRIMARY = "Primary" + """The parent scheduler is the primary in the failover configuration.""" + SECONDARY = "Secondary" + """The parent scheduler is the secondary in the failover configuration.""" + + class SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The name of the Stock Keeping Unit (SKU) of a Durable Task Scheduler.""" @@ -128,3 +214,12 @@ class SchedulerSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Dedicated SKU.""" CONSUMPTION = "Consumption" """Consumption SKU.""" + + +class TransparentDataEncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The key source for the transparent data encryption.""" + + MICROSOFT_MANAGED = "MicrosoftManaged" + """The key source is Microsoft-managed.""" + CUSTOMER_MANAGED = "CustomerManaged" + """The key source is customer-managed.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py index bfa5939e6772..2c52da0246db 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_models.py @@ -17,6 +17,255 @@ from .. import models as _models +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + """ + + +class Detector(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A diagnostic detector resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.DetectorProperties + """ + + properties: Optional["_models.DetectorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DetectorProperties"] = 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 DetectorDataset(_Model): + """A dataset produced by a detector. + + :ivar table: The tabular data produced by the detector. + :vartype table: ~azure.mgmt.durabletask.models.DetectorTable + :ivar rendering_properties: The rendering information for the tabular data. + :vartype rendering_properties: ~azure.mgmt.durabletask.models.DetectorRenderingProperties + """ + + table: Optional["_models.DetectorTable"] = rest_field(visibility=["read"]) + """The tabular data produced by the detector.""" + rendering_properties: Optional["_models.DetectorRenderingProperties"] = rest_field( + name="renderingProperties", visibility=["read"] + ) + """The rendering information for the tabular data.""" + + +class DetectorMetadata(_Model): + """Metadata that identifies and describes a detector. + + :ivar id: The unique identifier of the detector. + :vartype id: str + :ivar name: The display name of the detector. + :vartype name: str + :ivar description: A description of the detector. + :vartype description: str + :ivar author: The author of the detector when available for the caller. + :vartype author: str + :ivar category: The category of the detector. + :vartype category: str + :ivar support_topic_list: The case-submission support topic identifiers for which the detector + is enabled. + :vartype support_topic_list: list[str] + :ivar analysis_types: The analysis identifiers for which the detector is enabled. + :vartype analysis_types: list[str] + :ivar type: The kind of diagnostic response. Known values are: "Detector", "Analysis", and + "CategoryOverview". + :vartype type: str or ~azure.mgmt.durabletask.models.DetectorType + :ivar score: The match score when the detector is returned from a search. + :vartype score: float + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The unique identifier of the detector.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The display name of the detector.""" + description: Optional[str] = rest_field(visibility=["read"]) + """A description of the detector.""" + author: Optional[str] = rest_field(visibility=["read"]) + """The author of the detector when available for the caller.""" + category: Optional[str] = rest_field(visibility=["read"]) + """The category of the detector.""" + support_topic_list: Optional[list[str]] = rest_field(name="supportTopicList", visibility=["read"]) + """The case-submission support topic identifiers for which the detector is enabled.""" + analysis_types: Optional[list[str]] = rest_field(name="analysisTypes", visibility=["read"]) + """The analysis identifiers for which the detector is enabled.""" + type: Optional[Union[str, "_models.DetectorType"]] = rest_field(visibility=["read"]) + """The kind of diagnostic response. Known values are: \"Detector\", \"Analysis\", and + \"CategoryOverview\".""" + score: Optional[float] = rest_field(visibility=["read"]) + """The match score when the detector is returned from a search.""" + + +class DetectorProperties(_Model): + """The diagnostic response returned for a detector. + + :ivar provisioning_state: The provisioning state of the detector. Known values are: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar metadata: Metadata that identifies and describes the detector. + :vartype metadata: ~azure.mgmt.durabletask.models.DetectorMetadata + :ivar dataset: The datasets produced when the detector runs. + :vartype dataset: list[~azure.mgmt.durabletask.models.DetectorDataset] + :ivar status: The overall result of the detector. + :vartype status: ~azure.mgmt.durabletask.models.DetectorStatus + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the detector. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + metadata: Optional["_models.DetectorMetadata"] = rest_field(visibility=["read"]) + """Metadata that identifies and describes the detector.""" + dataset: Optional[list["_models.DetectorDataset"]] = rest_field(visibility=["read"]) + """The datasets produced when the detector runs.""" + status: Optional["_models.DetectorStatus"] = rest_field(visibility=["read"]) + """The overall result of the detector.""" + + +class DetectorRenderingProperties(_Model): + """The rendering information for a detector dataset. + + :ivar type: The rendering type for the dataset. Known values are: 1, 2, 3, 4, 5, 6, 7, 8, and + 9. + :vartype type: int or ~azure.mgmt.durabletask.models.DetectorRenderingType + :ivar title: The optional title of the rendering block. + :vartype title: str + :ivar description: The optional description of the rendering block. + :vartype description: str + """ + + type: Optional[Union[int, "_models.DetectorRenderingType"]] = rest_field(visibility=["read"]) + """The rendering type for the dataset. Known values are: 1, 2, 3, 4, 5, 6, 7, 8, and 9.""" + title: Optional[str] = rest_field(visibility=["read"]) + """The optional title of the rendering block.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The optional description of the rendering block.""" + + +class DetectorStatus(_Model): + """The overall result of a detector. + + :ivar message: The optional message describing the detector result. + :vartype message: str + :ivar status_id: The status of the detector result. Known values are: 0, 1, 2, 3, and 4. + :vartype status_id: int or ~azure.mgmt.durabletask.models.DetectorStatusId + """ + + message: Optional[str] = rest_field(visibility=["read"]) + """The optional message describing the detector result.""" + status_id: Optional[Union[int, "_models.DetectorStatusId"]] = rest_field(name="statusId", visibility=["read"]) + """The status of the detector result. Known values are: 0, 1, 2, 3, and 4.""" + + +class DetectorTable(_Model): + """A table included in a detector dataset. + + :ivar table_name: The name of the table. + :vartype table_name: str + :ivar columns: The column definitions for the table. + :vartype columns: list[~azure.mgmt.durabletask.models.DetectorTableColumn] + :ivar rows: The rows in the table. Values use the types specified by their columns. + :vartype rows: list[list[any]] + """ + + table_name: Optional[str] = rest_field(name="tableName", visibility=["read"]) + """The name of the table.""" + columns: Optional[list["_models.DetectorTableColumn"]] = rest_field(visibility=["read"]) + """The column definitions for the table.""" + rows: Optional[list[list[Any]]] = rest_field(visibility=["read"]) + """The rows in the table. Values use the types specified by their columns.""" + + +class DetectorTableColumn(_Model): + """A column definition in a detector table. + + :ivar column_name: The name of the column. + :vartype column_name: str + :ivar data_type: The data type of values in the column. + :vartype data_type: str + :ivar column_type: The optional semantic classification of the column. + :vartype column_type: str + """ + + column_name: Optional[str] = rest_field(name="columnName", visibility=["read"]) + """The name of the column.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read"]) + """The data type of values in the column.""" + column_type: Optional[str] = rest_field(name="columnType", visibility=["read"]) + """The optional semantic classification of the column.""" + + class ErrorAdditionalInfo(_Model): """The resource management error additional info. @@ -61,7 +310,7 @@ class ErrorDetail(_Model): """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -89,7 +338,159 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_Model): +class FailoverInstance(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A failover instance belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.FailoverInstanceProperties + """ + + properties: Optional["_models.FailoverInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FailoverInstanceProperties"] = 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 FailoverInstanceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The failover instance settings for the resource. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar replication_role: The replication role of the parent scheduler. Known values are: + "Primary" and "Secondary". + :vartype replication_role: str or ~azure.mgmt.durabletask.models.ReplicationRole + :ivar failover_state: The current state of the failover operation. Known values are: "None", + "InProgress", "Succeeded", and "Failed". + :vartype failover_state: str or ~azure.mgmt.durabletask.models.FailoverState + :ivar partner_scheduler_resource_id: The resource ID of the partner scheduler in the failover + configuration. Required. + :vartype partner_scheduler_resource_id: str + :ivar partner_scheduler_location: The location of the partner scheduler in the failover + configuration. + :vartype partner_scheduler_location: str + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + replication_role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """The replication role of the parent scheduler. Known values are: \"Primary\" and \"Secondary\".""" + failover_state: Optional[Union[str, "_models.FailoverState"]] = rest_field( + name="failoverState", visibility=["read"] + ) + """The current state of the failover operation. Known values are: \"None\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + partner_scheduler_resource_id: str = rest_field( + name="partnerSchedulerResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the partner scheduler in the failover configuration. Required.""" + partner_scheduler_location: Optional[str] = rest_field(name="partnerSchedulerLocation", visibility=["read"]) + """The location of the partner scheduler in the failover configuration.""" + + @overload + def __init__( + self, + *, + partner_scheduler_resource_id: str, + ) -> 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 ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.durabletask.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.durabletask.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = 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 Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -177,7 +578,7 @@ class OperationDisplay(_Model): views.""" -class OptionalPropertiesUpdateableProperties(_Model): +class OptionalPropertiesUpdateableProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The template for adding optional properties. :ivar private_endpoint: The private endpoint resource. @@ -228,35 +629,7 @@ class PrivateEndpoint(_Model): """The resource identifier of the private endpoint.""" -class Resource(_Model): - """Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class PrivateEndpointConnection(Resource): +class PrivateEndpointConnection(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """A private endpoint connection resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -297,7 +670,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionProperties(_Model): +class PrivateEndpointConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of the private endpoint connection. :ivar group_ids: The group ids for the private endpoint resource. @@ -350,7 +723,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionUpdate(_Model): +class PrivateEndpointConnectionUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """PATCH model for private endpoint connections. :ivar properties: The private endpoint connection properties. @@ -380,7 +753,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkResourceProperties(_Model): +class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a private link resource. :ivar group_id: The private link resource group id. @@ -418,7 +791,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkServiceConnectionState(_Model): +class PrivateLinkServiceConnectionState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A collection of information about the state of the connection between service consumer and provider. @@ -464,24 +837,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProxyResource(Resource): - """Proxy Resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.durabletask.models.SystemData - """ - - -class RetentionPolicy(ProxyResource): +class RetentionPolicy(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A retention policy resource belonging to the scheduler. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -522,7 +878,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RetentionPolicyDetails(_Model): +class RetentionPolicyDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of a retention policy. :ivar retention_period_in_days: The retention period in days after which the orchestration will @@ -565,7 +921,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RetentionPolicyProperties(_Model): +class RetentionPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The retention policy settings for the resource. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -603,7 +959,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResource(Resource): +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -647,7 +1003,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Scheduler(TrackedResource): +class Scheduler(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A Durable Task Scheduler resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -667,12 +1023,18 @@ class Scheduler(TrackedResource): :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.durabletask.models.SchedulerProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.durabletask.models.ManagedServiceIdentity """ properties: Optional["_models.SchedulerProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" @overload def __init__( @@ -681,6 +1043,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, properties: Optional["_models.SchedulerProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -694,7 +1057,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerPrivateLinkResource(Resource): +class SchedulerPrivateLinkResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """A private link resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -735,7 +1098,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerProperties(_Model): +class SchedulerProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details of the Scheduler. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -797,7 +1160,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerPropertiesUpdate(_Model): +class SchedulerPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The Scheduler resource properties to be updated. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -853,7 +1216,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerSku(_Model): +class SchedulerSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The SKU (Stock Keeping Unit) assigned to this durable task scheduler. :ivar name: The name of the SKU. Required. Known values are: "Dedicated" and "Consumption". @@ -897,7 +1260,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerSkuUpdate(_Model): +class SchedulerSkuUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The SKU (Stock Keeping Unit) properties to be updated. :ivar name: The name of the SKU. Known values are: "Dedicated" and "Consumption". @@ -941,13 +1304,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchedulerUpdate(_Model): +class SchedulerUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The update request model for the Scheduler resource. :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.durabletask.models.SchedulerPropertiesUpdate :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.durabletask.models.ManagedServiceIdentity """ properties: Optional["_models.SchedulerPropertiesUpdate"] = rest_field( @@ -956,6 +1321,10 @@ class SchedulerUpdate(_Model): """The resource-specific properties for this resource.""" tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" @overload def __init__( @@ -963,6 +1332,7 @@ def __init__( *, properties: Optional["_models.SchedulerPropertiesUpdate"] = None, tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -976,7 +1346,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -1043,7 +1413,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskHub(ProxyResource): +class TaskHub(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """A Task Hub resource belonging to the scheduler. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1084,7 +1454,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TaskHubProperties(_Model): +class TaskHubProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of Task Hub. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -1092,6 +1462,9 @@ class TaskHubProperties(_Model): :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState :ivar dashboard_url: URL of the durable task scheduler dashboard. :vartype dashboard_url: str + :ivar capabilities: A set of Task Hub capabilities that can be enabled or disabled for a Task + Hub. + :vartype capabilities: list[str] """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -1101,3 +1474,274 @@ class TaskHubProperties(_Model): \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" dashboard_url: Optional[str] = rest_field(name="dashboardUrl", visibility=["read"]) """URL of the durable task scheduler dashboard.""" + capabilities: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A set of Task Hub capabilities that can be enabled or disabled for a Task Hub.""" + + @overload + def __init__( + self, + *, + capabilities: 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 TaskQueue(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Task Queue resource belonging to a Task Hub. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TaskQueueProperties + """ + + properties: Optional["_models.TaskQueueProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TaskQueueProperties"] = 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 TaskQueueProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a Task Queue. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar throughput: The throughput configuration of the Task Queue. + :vartype throughput: ~azure.mgmt.durabletask.models.TaskQueueThroughput + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + throughput: Optional["_models.TaskQueueThroughput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The throughput configuration of the Task Queue.""" + + @overload + def __init__( + self, + *, + throughput: Optional["_models.TaskQueueThroughput"] = 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 TaskQueueThroughput(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The throughput configuration of a Task Queue. + + :ivar actions_per_second: The rate of work-item handouts per second. + :vartype actions_per_second: int + """ + + actions_per_second: Optional[int] = rest_field( + name="actionsPerSecond", visibility=["read", "create", "update", "delete", "query"] + ) + """The rate of work-item handouts per second.""" + + @overload + def __init__( + self, + *, + actions_per_second: Optional[int] = 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 TaskQueueUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The update request model for a Task Queue. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TaskQueueProperties + """ + + properties: Optional["_models.TaskQueueProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TaskQueueProperties"] = 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 TransparentDataEncryption(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A transparent data encryption resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.durabletask.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.durabletask.models.TransparentDataEncryptionProperties + """ + + properties: Optional["_models.TransparentDataEncryptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.TransparentDataEncryptionProperties"] = 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 TransparentDataEncryptionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The transparent data encryption settings for the resource. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.durabletask.models.ProvisioningState + :ivar key_source: The key source for the transparent data encryption. Required. Known values + are: "MicrosoftManaged" and "CustomerManaged". + :vartype key_source: str or ~azure.mgmt.durabletask.models.TransparentDataEncryptionKeySource + :ivar key_vault_key_uri: The URI of the key in Key Vault to be used for transparent data + encryption. + :vartype key_vault_key_uri: str + :ivar auto_rotation_enabled: Indicates whether auto-rotation of the customer-managed keys is + enabled for transparent data encryption. + :vartype auto_rotation_enabled: bool + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + key_source: Union[str, "_models.TransparentDataEncryptionKeySource"] = rest_field( + name="keySource", visibility=["read", "create", "update", "delete", "query"] + ) + """The key source for the transparent data encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + key_vault_key_uri: Optional[str] = rest_field( + name="keyVaultKeyUri", visibility=["read", "create", "update", "delete", "query"] + ) + """The URI of the key in Key Vault to be used for transparent data encryption.""" + auto_rotation_enabled: Optional[bool] = rest_field( + name="autoRotationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether auto-rotation of the customer-managed keys is enabled for transparent data + encryption.""" + + @overload + def __init__( + self, + *, + key_source: Union[str, "_models.TransparentDataEncryptionKeySource"], + key_vault_key_uri: Optional[str] = None, + auto_rotation_enabled: Optional[bool] = 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 UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/models/_patch.py @@ -8,7 +8,6 @@ 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 diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py index 18dc884c6cc0..2c8eaa1bc1f9 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/__init__.py @@ -13,9 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import DetectorsOperations # type: ignore from ._operations import SchedulersOperations # type: ignore from ._operations import TaskHubsOperations # type: ignore +from ._operations import TaskQueuesOperations # type: ignore from ._operations import RetentionPoliciesOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import FailoverInstancesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -23,9 +27,13 @@ __all__ = [ "Operations", + "DetectorsOperations", "SchedulersOperations", "TaskHubsOperations", + "TaskQueuesOperations", "RetentionPoliciesOperations", + "TransparentDataEncryptionsOperations", + "FailoverInstancesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py index 18abe743dff9..faace5f71da1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import DurableTaskMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -51,7 +50,7 @@ def build_operations_list_request(**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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,13 +65,70 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_detectors_get_request( + resource_group_name: str, scheduler_name: str, detector_id: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors/{detectorId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "detectorId": _SERIALIZER.url("detector_id", detector_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_detectors_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_schedulers_get_request( resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +157,7 @@ def build_schedulers_create_or_update_request( # pylint: disable=name-too-long _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +188,7 @@ def build_schedulers_update_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +217,7 @@ def build_schedulers_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}" path_format_arguments = { @@ -184,7 +240,7 @@ def build_schedulers_list_by_resource_group_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +269,7 @@ def build_schedulers_list_by_subscription_request( # pylint: disable=name-too-l _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +295,7 @@ def build_schedulers_get_private_link_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +324,7 @@ def build_schedulers_list_private_links_request( # pylint: disable=name-too-lon _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -300,7 +356,7 @@ def build_schedulers_get_private_endpoint_connection_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +392,7 @@ def build_schedulers_create_or_update_private_endpoint_connection_request( # py _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +430,7 @@ def build_schedulers_update_private_endpoint_connection_request( # pylint: disa _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -410,7 +466,7 @@ def build_schedulers_delete_private_endpoint_connection_request( # pylint: disa ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -436,7 +492,7 @@ def build_schedulers_list_private_endpoint_connections_request( # pylint: disab _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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -458,13 +514,35 @@ def build_schedulers_list_private_endpoint_connections_request( # pylint: disab return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_schedulers_restart_request( + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/restart" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + def build_task_hubs_get_request( resource_group_name: str, scheduler_name: str, task_hub_name: str, subscription_id: 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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -494,7 +572,7 @@ def build_task_hubs_create_or_update_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -524,7 +602,7 @@ def build_task_hubs_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}" path_format_arguments = { @@ -548,7 +626,7 @@ def build_task_hubs_list_by_scheduler_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -570,13 +648,182 @@ def build_task_hubs_list_by_scheduler_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_task_queues_get_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_update_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_task_queues_delete_request( + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + "taskQueueName": _SERIALIZER.url("task_queue_name", task_queue_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_task_queues_list_by_task_hub_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, task_hub_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + "taskHubName": _SERIALIZER.url("task_hub_name", task_hub_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_retention_policies_get_request( resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -605,7 +852,7 @@ def build_retention_policies_create_or_replace_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -636,7 +883,7 @@ def build_retention_policies_update_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -665,7 +912,7 @@ def build_retention_policies_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/retentionPolicies/default" path_format_arguments = { @@ -688,7 +935,7 @@ def build_retention_policies_list_by_scheduler_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", "2026-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -710,43 +957,317 @@ def build_retention_policies_list_by_scheduler_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. +def build_transparent_data_encryptions_get_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Instead, you should access the following operations through - :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`operations` attribute. - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """List the operations for the provider. + _url: str = _url.format(**path_format_arguments) # type: ignore - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_delete_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_transparent_data_encryptions_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_get_request( + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_delete_request( + resource_group_name: str, scheduler_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-07-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_failover_instances_list_by_scheduler_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_failover_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_instances_force_failover_allow_data_loss_request( # pylint: disable=name-too-long + resource_group_name: str, scheduler_name: str, subscription_id: 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", "2026-07-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "schedulerName": _SERIALIZER.url("scheduler_name", scheduler_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -774,7 +1295,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -817,7 +1341,221 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SchedulersOperations: +class DetectorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`detectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "detector_id", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def get(self, resource_group_name: str, scheduler_name: str, detector_id: str, **kwargs: Any) -> _models.Detector: + """Gets a diagnostic detector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param detector_id: The name of the Detector. Required. + :type detector_id: str + :return: Detector. The Detector is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.Detector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Detector] = kwargs.pop("cls", None) + + _request = build_detectors_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + detector_id=detector_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Detector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.Detector"]: + """Lists the diagnostic detectors belonging to a scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of Detector + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.Detector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Detector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_detectors_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Detector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SchedulersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -908,7 +1646,7 @@ def _create_or_update_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1014,7 +1752,7 @@ def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.Scheduler, *, content_type: str = "application/json", **kwargs: Any @@ -1027,7 +1765,7 @@ def begin_create_or_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.Scheduler :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1070,7 +1808,7 @@ def begin_create_or_update( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.Scheduler, JSON, IO[bytes]], + resource: Union[_models.Scheduler, _types.Scheduler, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Scheduler]: """Create or update a Scheduler. @@ -1080,9 +1818,10 @@ def begin_create_or_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: Scheduler, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.Scheduler or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Scheduler type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.Scheduler or + ~azure.mgmt.durabletask.types.Scheduler or IO[bytes] :return: An instance of LROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -1144,7 +1883,7 @@ def _update_initial( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1248,7 +1987,7 @@ def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: JSON, + properties: _types.SchedulerUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1261,7 +2000,7 @@ def begin_update( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.SchedulerUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1304,7 +2043,7 @@ def begin_update( self, resource_group_name: str, scheduler_name: str, - properties: Union[_models.SchedulerUpdate, JSON, IO[bytes]], + properties: Union[_models.SchedulerUpdate, _types.SchedulerUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Scheduler]: """Update a Scheduler. @@ -1314,9 +2053,10 @@ def begin_update( :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchedulerUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a SchedulerUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.SchedulerUpdate or + ~azure.mgmt.durabletask.types.SchedulerUpdate or IO[bytes] :return: An instance of LROPoller that returns Scheduler. The Scheduler is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.Scheduler] @@ -1542,7 +2282,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1632,7 +2375,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1687,7 +2433,7 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], ) def get_private_link( self, resource_group_name: str, scheduler_name: str, private_link_resource_name: str, **kwargs: Any @@ -1732,66 +2478,2603 @@ def get_private_link( path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchedulerPrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def list_private_links( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.SchedulerPrivateLinkResource"]: + """List private link resources for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of SchedulerPrivateLinkResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.SchedulerPrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SchedulerPrivateLinkResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schedulers_list_private_links_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SchedulerPrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def get_private_endpoint_connection( + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Get a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_schedulers_get_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schedulers_create_or_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: _types.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.PrivateEndpointConnection + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Create or update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Is either a PrivateEndpointConnection type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or + ~azure.mgmt.durabletask.types.PrivateEndpointConnection or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :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.PrivateEndpointConnection] = 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: + raw_result = self._create_or_update_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schedulers_update_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: _models.PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: _types.PrivateEndpointConnectionUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_update_private_endpoint_connection( + self, + resource_group_name: str, + scheduler_name: str, + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnectionUpdate, _types.PrivateEndpointConnectionUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param properties: The resource properties to be updated. Is either a + PrivateEndpointConnectionUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or + ~azure.mgmt.durabletask.types.PrivateEndpointConnectionUpdate or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :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.PrivateEndpointConnection] = 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: + raw_result = self._update_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_schedulers_delete_private_endpoint_connection_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "private_endpoint_connection_name", + ] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_delete_private_endpoint_connection( + self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a private endpoint connection for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-02-01", + params_added_on={ + "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-02-01", "2026-05-01-preview", "2026-07-01-preview"], + ) + def list_private_endpoint_connections( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateEndpointConnection"]: + """List private endpoint connections for the durable task scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of PrivateEndpointConnection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schedulers_list_private_endpoint_connections_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def restart( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> None: + """Restart a Scheduler. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_schedulers_restart_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TaskHubsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`task_hubs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: + """Get a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: TaskHub. The TaskHub is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskHub + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + + _request = build_task_hubs_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TaskHub, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_hubs_create_or_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: _models.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub + :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 TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: _types.TaskHub, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TaskHub + :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 TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + resource: Union[_models.TaskHub, _types.TaskHub, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskHub]: + """Create or Update a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param resource: Resource create parameters. Is either a TaskHub type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskHub or ~azure.mgmt.durabletask.types.TaskHub + or IO[bytes] + :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :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.TaskHub] = 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: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskHub, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskHub].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskHub]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_task_hubs_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Task Hub. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.TaskHub"]: + """List Task Hubs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of TaskHub + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TaskHub]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_task_hubs_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TaskHub], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TaskQueuesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`task_queues` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def get( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> _models.TaskQueue: + """Get a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: TaskQueue. The TaskQueue is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TaskQueue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TaskQueue] = kwargs.pop("cls", None) + + _request = build_task_queues_get_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TaskQueue, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_queues_create_or_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: _models.TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue + :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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: _types.TaskQueue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.durabletask.types.TaskQueue + :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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + resource: Union[_models.TaskQueue, _types.TaskQueue, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Create or update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param resource: Resource create parameters. Is either a TaskQueue type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.durabletask.models.TaskQueue or + ~azure.mgmt.durabletask.types.TaskQueue or IO[bytes] + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :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.TaskQueue] = 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: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskQueue, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskQueue].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskQueue]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _update_initial( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_task_queues_update_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: _models.TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate + :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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: _types.TaskQueueUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.durabletask.types.TaskQueueUpdate + :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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_update( + self, + resource_group_name: str, + scheduler_name: str, + task_hub_name: str, + task_queue_name: str, + properties: Union[_models.TaskQueueUpdate, _types.TaskQueueUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TaskQueue]: + """Update a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :param properties: The resource properties to be updated. Is either a TaskQueueUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.TaskQueueUpdate or + ~azure.mgmt.durabletask.types.TaskQueueUpdate or IO[bytes] + :return: An instance of LROPoller that returns TaskQueue. The TaskQueue is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskQueue] + :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.TaskQueue] = 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: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + properties=properties, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TaskQueue, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TaskQueue].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TaskQueue]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _delete_initial( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_task_queues_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "task_queue_name", + ] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_delete( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, task_queue_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Task Queue. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :param task_queue_name: The name of the TaskQueue. Required. + :type task_queue_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + task_hub_name=task_hub_name, + task_queue_name=task_queue_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.SchedulerPrivateLinkResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2026-07-01-preview", params_added_on={ - "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "task_hub_name", + "accept", + ] }, - api_versions_list=["2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def list_private_links( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.SchedulerPrivateLinkResource"]: - """List private link resources for the durable task scheduler. + def list_by_task_hub( + self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any + ) -> ItemPaged["_models.TaskQueue"]: + """List Task Queues by Task Hub. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of SchedulerPrivateLinkResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.SchedulerPrivateLinkResource] + :param task_hub_name: The name of the TaskHub. Required. + :type task_hub_name: str + :return: An iterator like instance of TaskQueue + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskQueue] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchedulerPrivateLinkResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TaskQueue]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1804,9 +5087,10 @@ def list_private_links( def prepare_request(next_link=None): if not next_link: - _request = build_schedulers_list_private_links_request( + _request = build_task_queues_list_by_task_hub_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, + task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1830,7 +5114,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1844,7 +5131,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchedulerPrivateLinkResource], + List[_models.TaskQueue], deserialized.get("value", []), ) if cls: @@ -1872,37 +5159,48 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + +class RetentionPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s + :attr:`retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DurableTaskMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - "accept", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def get_private_endpoint_connection( - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get a private endpoint connection for the durable task scheduler. + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: + """Get a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1916,12 +5214,11 @@ def get_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) - _request = build_schedulers_get_private_endpoint_connection_request( + _request = build_retention_policies_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1956,7 +5253,7 @@ def get_private_endpoint_connection( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1964,26 +5261,30 @@ def get_private_endpoint_connection( return deserialized # type: ignore @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _create_or_update_private_endpoint_connection_initial( # pylint: disable=name-too-long + def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2007,10 +5308,9 @@ def _create_or_update_private_endpoint_connection_initial( # pylint: disable=na else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schedulers_create_or_update_private_endpoint_connection_request( + _request = build_retention_policies_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2058,156 +5358,145 @@ def _create_or_update_private_endpoint_connection_initial( # pylint: disable=na return deserialized # type: ignore @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: _models.PrivateEndpointConnection, + resource: _models.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: JSON, + resource: _types.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.RetentionPolicy :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param resource: Resource create parameters. Required. :type resource: 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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_create_or_update_private_endpoint_connection( # pylint: disable=name-too-long + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - resource: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + resource: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Create or update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Create or Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param resource: Resource create parameters. Is one of the following types: - PrivateEndpointConnection, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.PrivateEndpointConnection or JSON or IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :param resource: Resource create parameters. Is either a RetentionPolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :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.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = 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: - raw_result = self._create_or_update_private_endpoint_connection_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -2220,7 +5509,7 @@ def begin_create_or_update_private_endpoint_connection( # pylint: disable=name- def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2238,37 +5527,41 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return LROPoller[_models.RetentionPolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PrivateEndpointConnection]( + return LROPoller[_models.RetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _update_private_endpoint_connection_initial( # pylint: disable=name-too-long + def _update_initial( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2292,10 +5585,9 @@ def _update_private_endpoint_connection_initial( # pylint: disable=name-too-lon else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schedulers_update_private_endpoint_connection_request( + _request = build_retention_policies_update_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2341,157 +5633,145 @@ def _update_private_endpoint_connection_initial( # pylint: disable=name-too-lon return deserialized # type: ignore @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: _models.PrivateEndpointConnectionUpdate, + properties: _models.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: JSON, + properties: _types.RetentionPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.durabletask.types.RetentionPolicy :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :param properties: The resource properties to be updated. Required. :type properties: 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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ + "2025-04-01-preview": [ "api_version", "subscription_id", "resource_group_name", "scheduler_name", - "private_endpoint_connection_name", "content_type", "accept", ] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_update_private_endpoint_connection( + def begin_update( self, resource_group_name: str, scheduler_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + properties: Union[_models.RetentionPolicy, _types.RetentionPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update a private endpoint connection for the durable task scheduler. + ) -> LROPoller[_models.RetentionPolicy]: + """Update a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :param properties: The resource properties to be updated. Is either a RetentionPolicy type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or + ~azure.mgmt.durabletask.types.RetentionPolicy or IO[bytes] + :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] :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.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.RetentionPolicy] = 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: - raw_result = self._update_private_endpoint_connection_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -2504,7 +5784,7 @@ def begin_update_private_endpoint_connection( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.RetentionPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2522,32 +5802,30 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return LROPoller[_models.RetentionPolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PrivateEndpointConnection]( + return LROPoller[_models.RetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-long - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2561,10 +5839,9 @@ def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-lon cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schedulers_delete_private_endpoint_connection_request( + _request = build_retention_policies_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2609,31 +5886,26 @@ def _delete_private_endpoint_connection_initial( # pylint: disable=name-too-lon @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "private_endpoint_connection_name", - ] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def begin_delete_private_endpoint_connection( - self, resource_group_name: str, scheduler_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a private endpoint connection for the durable task scheduler. + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Retention Policy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2646,10 +5918,9 @@ def begin_delete_private_endpoint_connection( 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._delete_private_endpoint_connection_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2685,30 +5956,36 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2026-02-01", + method_added_on="2025-04-01-preview", params_added_on={ - "2026-02-01": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2026-02-01"], + api_versions_list=[ + "2025-04-01-preview", + "2025-11-01", + "2026-02-01", + "2026-05-01-preview", + "2026-07-01-preview", + ], ) - def list_private_endpoint_connections( + def list_by_scheduler( self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnection"]: - """List private endpoint connections for the durable task scheduler. + ) -> ItemPaged["_models.RetentionPolicy"]: + """List Retention Policies. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of PrivateEndpointConnection - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.PrivateEndpointConnection] + :return: An iterator like instance of RetentionPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2721,7 +5998,7 @@ def list_private_endpoint_connections( def prepare_request(next_link=None): if not next_link: - _request = build_schedulers_list_private_endpoint_connections_request( + _request = build_retention_policies_list_by_scheduler_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -2747,7 +6024,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2761,7 +6041,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PrivateEndpointConnection], + List[_models.RetentionPolicy], deserialized.get("value", []), ) if cls: @@ -2790,14 +6070,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class TaskHubsOperations: +class TransparentDataEncryptionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`task_hubs` attribute. + :attr:`transparent_data_encryptions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2808,18 +6088,24 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any) -> _models.TaskHub: - """Get a Task Hub. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.TransparentDataEncryption: + """Get a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str - :return: TaskHub. The TaskHub is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.TaskHub + :return: TransparentDataEncryption. The TransparentDataEncryption is compatible with + MutableMapping + :rtype: ~azure.mgmt.durabletask.models.TransparentDataEncryption :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2833,12 +6119,11 @@ def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.TaskHub] = kwargs.pop("cls", None) + cls: ClsType[_models.TransparentDataEncryption] = kwargs.pop("cls", None) - _request = build_task_hubs_get_request( + _request = build_transparent_data_encryptions_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2873,19 +6158,32 @@ def get(self, resource_group_name: str, scheduler_name: str, task_hub_name: str, if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.TaskHub, response.json()) + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2909,10 +6207,9 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_task_hubs_create_or_update_request( + _request = build_transparent_data_encryptions_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2960,137 +6257,139 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: _models.TaskHub, + resource: _models.TransparentDataEncryption, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption :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 TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: JSON, + resource: _types.TransparentDataEncryption, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.TransparentDataEncryption :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 TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :param resource: Resource create parameters. Required. :type resource: 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 TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "scheduler_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - task_hub_name: str, - resource: Union[_models.TaskHub, JSON, IO[bytes]], + resource: Union[_models.TransparentDataEncryption, _types.TransparentDataEncryption, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.TaskHub]: - """Create or Update a Task Hub. + ) -> LROPoller[_models.TransparentDataEncryption]: + """Create or Update a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str - :param resource: Resource create parameters. Is one of the following types: TaskHub, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.TaskHub or JSON or IO[bytes] - :return: An instance of LROPoller that returns TaskHub. The TaskHub is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TaskHub] + :param resource: Resource create parameters. Is either a TransparentDataEncryption type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.durabletask.models.TransparentDataEncryption or + ~azure.mgmt.durabletask.types.TransparentDataEncryption or IO[bytes] + :return: An instance of LROPoller that returns TransparentDataEncryption. The + TransparentDataEncryption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.TransparentDataEncryption] :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.TaskHub] = kwargs.pop("cls", None) + cls: ClsType[_models.TransparentDataEncryption] = 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: - raw_result = self._create_or_update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3103,7 +6402,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.TaskHub, response.json()) + deserialized = _deserialize(_models.TransparentDataEncryption, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3121,19 +6420,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.TaskHub].from_continuation_token( + return LROPoller[_models.TransparentDataEncryption].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.TaskHub]( + return LROPoller[_models.TransparentDataEncryption]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any - ) -> Iterator[bytes]: + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3147,10 +6451,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_task_hubs_delete_request( + _request = build_transparent_data_encryptions_delete_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3194,18 +6497,21 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - def begin_delete( - self, resource_group_name: str, scheduler_name: str, task_hub_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Task Hub. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Transparent Data Encryption. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param task_hub_name: The name of the TaskHub. Required. - :type task_hub_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3221,7 +6527,6 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - task_hub_name=task_hub_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3256,24 +6561,31 @@ 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 + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-05-01-preview", "2026-07-01-preview"], + ) def list_by_scheduler( self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.TaskHub"]: - """List Task Hubs. + ) -> ItemPaged["_models.TransparentDataEncryption"]: + """List Transparent Data Encryptions. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An iterator like instance of TaskHub - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TaskHub] + :return: An iterator like instance of TransparentDataEncryption + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.TransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.TaskHub]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.TransparentDataEncryption]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3286,7 +6598,7 @@ def list_by_scheduler( def prepare_request(next_link=None): if not next_link: - _request = build_task_hubs_list_by_scheduler_request( + _request = build_transparent_data_encryptions_list_by_scheduler_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3312,7 +6624,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3326,7 +6641,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.TaskHub], + List[_models.TransparentDataEncryption], deserialized.get("value", []), ) if cls: @@ -3355,14 +6670,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class RetentionPoliciesOperations: +class FailoverInstancesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.durabletask.DurableTaskMgmtClient`'s - :attr:`retention_policies` attribute. + :attr:`failover_instances` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3374,22 +6689,22 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.RetentionPolicy: - """Get a Retention Policy. + def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _models.FailoverInstance: + """Get a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: RetentionPolicy. The RetentionPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.durabletask.models.RetentionPolicy + :return: FailoverInstance. The FailoverInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.durabletask.models.FailoverInstance :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3403,9 +6718,9 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = kwargs.pop("cls", None) - _request = build_retention_policies_get_request( + _request = build_failover_instances_get_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3442,7 +6757,7 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3450,9 +6765,9 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ return deserialized # type: ignore @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", @@ -3461,13 +6776,13 @@ def get(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> _ "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) def _create_or_replace_initial( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3491,7 +6806,7 @@ def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_retention_policies_create_or_replace_request( + _request = build_failover_instances_create_or_replace_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -3545,12 +6860,12 @@ def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: _models.RetentionPolicy, + resource: _models.FailoverInstance, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3558,13 +6873,13 @@ def begin_create_or_replace( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance :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 RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3573,12 +6888,12 @@ def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: JSON, + resource: _types.FailoverInstance, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3586,13 +6901,13 @@ def begin_create_or_replace( :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.durabletask.types.FailoverInstance :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 RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3605,8 +6920,8 @@ def begin_create_or_replace( *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3618,17 +6933,17 @@ def begin_create_or_replace( :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 RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ + "2026-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", @@ -3637,35 +6952,36 @@ def begin_create_or_replace( "accept", ] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) def begin_create_or_replace( self, resource_group_name: str, scheduler_name: str, - resource: Union[_models.RetentionPolicy, JSON, IO[bytes]], + resource: Union[_models.FailoverInstance, _types.FailoverInstance, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Create or Update a Retention Policy. + ) -> LROPoller[_models.FailoverInstance]: + """Create or Update a Failover Instance. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param resource: Resource create parameters. Is one of the following types: RetentionPolicy, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :param resource: Resource create parameters. Is either a FailoverInstance type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.durabletask.models.FailoverInstance or + ~azure.mgmt.durabletask.types.FailoverInstance or IO[bytes] + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :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.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = 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) @@ -3685,7 +7001,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3703,37 +7019,263 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.RetentionPolicy].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.RetentionPolicy]( + return LROPoller[_models.FailoverInstance]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "content_type", - "accept", - ] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def _update_initial( - self, - resource_group_name: str, - scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_instances_delete_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Failover Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def list_by_scheduler( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> ItemPaged["_models.FailoverInstance"]: + """List Failover Instances. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param scheduler_name: The name of the Scheduler. Required. + :type scheduler_name: str + :return: An iterator like instance of FailoverInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.FailoverInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_instances_list_by_scheduler_request( + resource_group_name=resource_group_name, + scheduler_name=scheduler_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2026-07-01-preview", + params_added_on={ + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] + }, + api_versions_list=["2026-07-01-preview"], + ) + def _failover_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3742,26 +7284,16 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_retention_policies_update_request( + _request = build_failover_instances_failover_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3802,141 +7334,40 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: _models.RetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy - :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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 RetentionPolicy. The RetentionPolicy is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "scheduler_name", - "content_type", - "accept", - ] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def begin_update( - self, - resource_group_name: str, - scheduler_name: str, - properties: Union[_models.RetentionPolicy, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.RetentionPolicy]: - """Update a Retention Policy. + def begin_failover( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverInstance]: + """Trigger a graceful failover for the parent scheduler. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :param properties: The resource properties to be updated. Is one of the following types: - RetentionPolicy, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.durabletask.models.RetentionPolicy or JSON or IO[bytes] - :return: An instance of LROPoller that returns RetentionPolicy. The RetentionPolicy is + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.RetentionPolicy] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.RetentionPolicy] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = 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: - raw_result = self._update_initial( + raw_result = self._failover_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, - properties=properties, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3947,7 +7378,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.RetentionPolicy, response.json()) + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3965,24 +7396,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.RetentionPolicy].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.RetentionPolicy]( + return LROPoller[_models.FailoverInstance]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> Iterator[bytes]: + def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3996,7 +7429,7 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_retention_policies_delete_request( + _request = build_failover_instances_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, scheduler_name=scheduler_name, subscription_id=self._config.subscription_id, @@ -4017,7 +7450,7 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4043,33 +7476,36 @@ def _delete_initial(self, resource_group_name: str, scheduler_name: str, **kwarg @distributed_trace @api_version_validation( - method_added_on="2025-04-01-preview", + method_added_on="2026-07-01-preview", params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name"] + "2026-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], + api_versions_list=["2026-07-01-preview"], ) - def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Retention Policy. + def begin_force_failover_allow_data_loss( + self, resource_group_name: str, scheduler_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverInstance]: + """Trigger a forced failover with potential data loss for the parent scheduler. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param scheduler_name: The name of the Scheduler. Required. :type scheduler_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns FailoverInstance. The FailoverInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.durabletask.models.FailoverInstance] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.FailoverInstance] = 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: - raw_result = self._delete_initial( + raw_result = self._force_failover_allow_data_loss_initial( resource_group_name=resource_group_name, scheduler_name=scheduler_name, cls=lambda x, y, z: x, @@ -4080,9 +7516,12 @@ def begin_delete(self, resource_group_name: str, scheduler_name: str, **kwargs: raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverInstance, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -4097,116 +7536,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.FailoverInstance].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-04-01-preview", - params_added_on={ - "2025-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "scheduler_name", "accept"] - }, - api_versions_list=["2025-04-01-preview", "2025-11-01", "2026-02-01"], - ) - def list_by_scheduler( - self, resource_group_name: str, scheduler_name: str, **kwargs: Any - ) -> ItemPaged["_models.RetentionPolicy"]: - """List Retention Policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param scheduler_name: The name of the Scheduler. Required. - :type scheduler_name: str - :return: An iterator like instance of RetentionPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.durabletask.models.RetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RetentionPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_retention_policies_list_by_scheduler_request( - resource_group_name=resource_group_name, - scheduler_name=scheduler_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RetentionPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[_models.FailoverInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/operations/_patch.py @@ -8,7 +8,6 @@ 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 diff --git a/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py new file mode 100644 index 000000000000..ca9b227c6acf --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/types.py @@ -0,0 +1,721 @@ +# 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 typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + CreatedByType, + FailoverState, + ManagedServiceIdentityType, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccess, + PurgeableOrchestrationState, + RedundancyState, + ReplicationRole, + SchedulerSkuName, + TransparentDataEncryptionKeySource, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class FailoverInstance(ProxyResource): + """A failover instance belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "FailoverInstanceProperties" + """ + + properties: "FailoverInstanceProperties" + """The resource-specific properties for this resource.""" + + +class FailoverInstanceProperties(TypedDict, total=False): + """The failover instance settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar replicationRole: The replication role of the parent scheduler. Known values are: + "Primary" and "Secondary". + :vartype replicationRole: Union[str, "ReplicationRole"] + :ivar failoverState: The current state of the failover operation. Known values are: "None", + "InProgress", "Succeeded", and "Failed". + :vartype failoverState: Union[str, "FailoverState"] + :ivar partnerSchedulerResourceId: The resource ID of the partner scheduler in the failover + configuration. Required. + :vartype partnerSchedulerResourceId: str + :ivar partnerSchedulerLocation: The location of the partner scheduler in the failover + configuration. + :vartype partnerSchedulerLocation: str + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + replicationRole: Union[str, "ReplicationRole"] + """The replication role of the parent scheduler. Known values are: \"Primary\" and \"Secondary\".""" + failoverState: Union[str, "FailoverState"] + """The current state of the failover operation. Known values are: \"None\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + partnerSchedulerResourceId: Required[str] + """The resource ID of the partner scheduler in the failover configuration. Required.""" + partnerSchedulerLocation: str + """The location of the partner scheduler in the failover configuration.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class OptionalPropertiesUpdateableProperties(TypedDict, total=False): + """The template for adding optional properties. + + :ivar privateEndpoint: The private endpoint resource. + :vartype privateEndpoint: "PrivateEndpoint" + :ivar privateLinkServiceConnectionState: A collection of information about the state of the + connection between service consumer and provider. + :vartype privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + """ + + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + """A collection of information about the state of the connection between service consumer and + provider.""" + + +class PrivateEndpoint(TypedDict, total=False): + """The private endpoint resource. + + :ivar id: The resource identifier of the private endpoint. + :vartype id: str + """ + + id: str + """The resource identifier of the private endpoint.""" + + +class PrivateEndpointConnection(Resource): + """A private endpoint connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The private endpoint connection properties. + :vartype properties: "PrivateEndpointConnectionProperties" + """ + + properties: "PrivateEndpointConnectionProperties" + """The private endpoint connection properties.""" + + +class PrivateEndpointConnectionProperties(TypedDict, total=False): + """Properties of the private endpoint connection. + + :ivar groupIds: The group ids for the private endpoint resource. + :vartype groupIds: list[str] + :ivar privateEndpoint: The private endpoint resource. + :vartype privateEndpoint: "PrivateEndpoint" + :ivar privateLinkServiceConnectionState: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + :ivar provisioningState: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". + :vartype provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """ + + groupIds: list[str] + """The group ids for the private endpoint resource.""" + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: Required["PrivateLinkServiceConnectionState"] + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """The provisioning state of the private endpoint connection resource. Known values are: + \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\".""" + + +class PrivateEndpointConnectionUpdate(TypedDict, total=False): + """PATCH model for private endpoint connections. + + :ivar properties: The private endpoint connection properties. + :vartype properties: "OptionalPropertiesUpdateableProperties" + """ + + properties: "OptionalPropertiesUpdateableProperties" + """The private endpoint connection properties.""" + + +class PrivateLinkServiceConnectionState(TypedDict, total=False): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: Union[str, "PrivateEndpointServiceConnectionStatus"] + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actionsRequired: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actionsRequired: str + """ + + status: Union[str, "PrivateEndpointServiceConnectionStatus"] + """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" + description: str + """The reason for approval/rejection of the connection.""" + actionsRequired: str + """A message indicating if changes on the service provider require any updates on the consumer.""" + + +class RetentionPolicy(ProxyResource): + """A retention policy resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "RetentionPolicyProperties" + """ + + properties: "RetentionPolicyProperties" + """The resource-specific properties for this resource.""" + + +class RetentionPolicyDetails(TypedDict, total=False): + """The properties of a retention policy. + + :ivar retentionPeriodInDays: The retention period in days after which the orchestration will be + purged automatically. Required. + :vartype retentionPeriodInDays: int + :ivar orchestrationState: The orchestration state to which this policy applies. If omitted, the + policy applies to all purgeable orchestration states. Known values are: "Completed", "Failed", + "Terminated", and "Canceled". + :vartype orchestrationState: Union[str, "PurgeableOrchestrationState"] + """ + + retentionPeriodInDays: Required[int] + """The retention period in days after which the orchestration will be purged automatically. + Required.""" + orchestrationState: Union[str, "PurgeableOrchestrationState"] + """The orchestration state to which this policy applies. If omitted, the policy applies to all + purgeable orchestration states. Known values are: \"Completed\", \"Failed\", \"Terminated\", + and \"Canceled\".""" + + +class RetentionPolicyProperties(TypedDict, total=False): + """The retention policy settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar retentionPolicies: The orchestration retention policies. + :vartype retentionPolicies: list["RetentionPolicyDetails"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + retentionPolicies: list["RetentionPolicyDetails"] + """The orchestration retention policies.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class Scheduler(TrackedResource): + """A Durable Task Scheduler resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchedulerProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "SchedulerProperties" + """The resource-specific properties for this resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class SchedulerProperties(TypedDict, total=False): + """Details of the Scheduler. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar endpoint: URL of the durable task scheduler. + :vartype endpoint: str + :ivar ipAllowlist: IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. + Required. + :vartype ipAllowlist: list[str] + :ivar sku: SKU of the durable task scheduler. Required. + :vartype sku: "SchedulerSku" + :ivar publicNetworkAccess: Allow or disallow public network access to durable task scheduler. + Known values are: "Enabled" and "Disabled". + :vartype publicNetworkAccess: Union[str, "PublicNetworkAccess"] + :ivar privateEndpointConnections: The private endpoints exposed by this resource. + :vartype privateEndpointConnections: list["PrivateEndpointConnection"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + endpoint: str + """URL of the durable task scheduler.""" + ipAllowlist: Required[list[str]] + """IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. Required.""" + sku: Required["SchedulerSku"] + """SKU of the durable task scheduler. Required.""" + publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """Allow or disallow public network access to durable task scheduler. Known values are: + \"Enabled\" and \"Disabled\".""" + privateEndpointConnections: list["PrivateEndpointConnection"] + """The private endpoints exposed by this resource.""" + + +class SchedulerPropertiesUpdate(TypedDict, total=False): + """The Scheduler resource properties to be updated. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar endpoint: URL of the durable task scheduler. + :vartype endpoint: str + :ivar ipAllowlist: IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR. + :vartype ipAllowlist: list[str] + :ivar sku: SKU of the durable task scheduler. + :vartype sku: "SchedulerSkuUpdate" + :ivar publicNetworkAccess: Allow or disallow public network access to durable task scheduler. + Known values are: "Enabled" and "Disabled". + :vartype publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + endpoint: str + """URL of the durable task scheduler.""" + ipAllowlist: list[str] + """IP allow list for durable task scheduler. Values can be IPv4, IPv6 or CIDR.""" + sku: "SchedulerSkuUpdate" + """SKU of the durable task scheduler.""" + publicNetworkAccess: Union[str, "PublicNetworkAccess"] + """Allow or disallow public network access to durable task scheduler. Known values are: + \"Enabled\" and \"Disabled\".""" + + +class SchedulerSku(TypedDict, total=False): + """The SKU (Stock Keeping Unit) assigned to this durable task scheduler. + + :ivar name: The name of the SKU. Required. Known values are: "Dedicated" and "Consumption". + :vartype name: Union[str, "SchedulerSkuName"] + :ivar capacity: The SKU capacity. This allows scale out/in for the resource and impacts zone + redundancy. + :vartype capacity: int + :ivar redundancyState: Indicates whether the current SKU configuration is zone redundant. Known + values are: "None" and "Zone". + :vartype redundancyState: Union[str, "RedundancyState"] + """ + + name: Required[Union[str, "SchedulerSkuName"]] + """The name of the SKU. Required. Known values are: \"Dedicated\" and \"Consumption\".""" + capacity: int + """The SKU capacity. This allows scale out/in for the resource and impacts zone redundancy.""" + redundancyState: Union[str, "RedundancyState"] + """Indicates whether the current SKU configuration is zone redundant. Known values are: \"None\" + and \"Zone\".""" + + +class SchedulerSkuUpdate(TypedDict, total=False): + """The SKU (Stock Keeping Unit) properties to be updated. + + :ivar name: The name of the SKU. Known values are: "Dedicated" and "Consumption". + :vartype name: Union[str, "SchedulerSkuName"] + :ivar capacity: The SKU capacity. This allows scale out/in for the resource and impacts zone + redundancy. + :vartype capacity: int + :ivar redundancyState: Indicates whether the current SKU configuration is zone redundant. Known + values are: "None" and "Zone". + :vartype redundancyState: Union[str, "RedundancyState"] + """ + + name: Union[str, "SchedulerSkuName"] + """The name of the SKU. Known values are: \"Dedicated\" and \"Consumption\".""" + capacity: int + """The SKU capacity. This allows scale out/in for the resource and impacts zone redundancy.""" + redundancyState: Union[str, "RedundancyState"] + """Indicates whether the current SKU configuration is zone redundant. Known values are: \"None\" + and \"Zone\".""" + + +class SchedulerUpdate(TypedDict, total=False): + """The update request model for the Scheduler resource. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchedulerPropertiesUpdate" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "SchedulerPropertiesUpdate" + """The resource-specific properties for this resource.""" + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TaskHub(ProxyResource): + """A Task Hub resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskHubProperties" + """ + + properties: "TaskHubProperties" + """The resource-specific properties for this resource.""" + + +class TaskHubProperties(TypedDict, total=False): + """The properties of Task Hub. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar dashboardUrl: URL of the durable task scheduler dashboard. + :vartype dashboardUrl: str + :ivar capabilities: A set of Task Hub capabilities that can be enabled or disabled for a Task + Hub. + :vartype capabilities: list[str] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + dashboardUrl: str + """URL of the durable task scheduler dashboard.""" + capabilities: list[str] + """A set of Task Hub capabilities that can be enabled or disabled for a Task Hub.""" + + +class TaskQueue(ProxyResource): + """A Task Queue resource belonging to a Task Hub. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskQueueProperties" + """ + + properties: "TaskQueueProperties" + """The resource-specific properties for this resource.""" + + +class TaskQueueProperties(TypedDict, total=False): + """The properties of a Task Queue. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar throughput: The throughput configuration of the Task Queue. + :vartype throughput: "TaskQueueThroughput" + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + throughput: "TaskQueueThroughput" + """The throughput configuration of the Task Queue.""" + + +class TaskQueueThroughput(TypedDict, total=False): + """The throughput configuration of a Task Queue. + + :ivar actionsPerSecond: The rate of work-item handouts per second. + :vartype actionsPerSecond: int + """ + + actionsPerSecond: int + """The rate of work-item handouts per second.""" + + +class TaskQueueUpdate(TypedDict, total=False): + """The update request model for a Task Queue. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TaskQueueProperties" + """ + + properties: "TaskQueueProperties" + """The resource-specific properties for this resource.""" + + +class TransparentDataEncryption(ProxyResource): + """A transparent data encryption resource belonging to the scheduler. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "TransparentDataEncryptionProperties" + """ + + properties: "TransparentDataEncryptionProperties" + """The resource-specific properties for this resource.""" + + +class TransparentDataEncryptionProperties(TypedDict, total=False): + """The transparent data encryption settings for the resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar keySource: The key source for the transparent data encryption. Required. Known values + are: "MicrosoftManaged" and "CustomerManaged". + :vartype keySource: Union[str, "TransparentDataEncryptionKeySource"] + :ivar keyVaultKeyUri: The URI of the key in Key Vault to be used for transparent data + encryption. + :vartype keyVaultKeyUri: str + :ivar autoRotationEnabled: Indicates whether auto-rotation of the customer-managed keys is + enabled for transparent data encryption. + :vartype autoRotationEnabled: bool + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + keySource: Required[Union[str, "TransparentDataEncryptionKeySource"]] + """The key source for the transparent data encryption. Required. Known values are: + \"MicrosoftManaged\" and \"CustomerManaged\".""" + keyVaultKeyUri: str + """The URI of the key in Key Vault to be used for transparent data encryption.""" + autoRotationEnabled: bool + """Indicates whether auto-rotation of the customer-managed keys is enabled for transparent data + encryption.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py new file mode 100644 index 000000000000..3c218f805d01 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_get.py @@ -0,0 +1,43 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python detectors_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.detectors.get( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + detector_id="cpuhealth", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/Detectors_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py new file mode 100644 index 000000000000..ccb646de07dd --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/detectors_list_by_scheduler.py @@ -0,0 +1,43 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python detectors_list_by_scheduler.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.detectors.list_by_scheduler( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/Detectors_ListByScheduler.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py new file mode 100644 index 000000000000..f471c8dabb65 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_create_or_replace_maximum_set_gen.py @@ -0,0 +1,48 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_create_or_replace_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_create_or_replace( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + resource={ + "properties": { + "partnerSchedulerResourceId": "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask-secondary/providers/Microsoft.DurableTask/schedulers/testscheduler-secondary" + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_CreateOrReplace_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py new file mode 100644 index 000000000000..a9f8740e5976 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_delete_maximum_set_gen.py @@ -0,0 +1,41 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.failover_instances.begin_delete( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py new file mode 100644 index 000000000000..450906b6d357 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_failover.py @@ -0,0 +1,42 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_failover.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_failover( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Failover.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py new file mode 100644 index 000000000000..076556b8de79 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_force_failover_allow_data_loss.py @@ -0,0 +1,42 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_force_failover_allow_data_loss.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_ForceFailoverAllowDataLoss.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py new file mode 100644 index 000000000000..b292e0d32141 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_get_maximum_set_gen.py @@ -0,0 +1,42 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.get( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py new file mode 100644 index 000000000000..6da395321c06 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/failover_instances_list_by_scheduler_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python failover_instances_list_by_scheduler_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_instances.list_by_scheduler( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/FailoverInstances_ListByScheduler_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py index 620d5d0dbd8e..318c01bc13db 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Operations_List.json +# x-ms-original-file: 2026-07-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py index 5ed09e5d6d21..939987175565 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_create_maximum_set_gen.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py index bad74af3e971..2c3974c0736c 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py index 6e0d8832d95a..64ddf5326515 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py index a5f4c3348534..83652ecc9cf4 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_list_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py index 3ad1d020dce3..fcde80cd55af 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_endpoint_connections_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Update.json +# x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Update.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py index a93718ecc69c..54a3beb79b65 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/PrivateLinkResources_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py index 377f28ae4385..3727cd15fd15 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/private_link_resources_list_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/PrivateLinkResources_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py index c4b2b2dd832c..57acc66c93b1 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_create_or_replace_maximum_set_gen.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py index 7db2aeac74d2..599aad86378f 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/RetentionPolicies_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py index 19f9ba8febac..ec6426163dbe 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py index 7570b91005ab..eae681d27a0e 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_list_by_scheduler_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py index 6ee0acf008a8..c6a9478e3dc5 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/retention_policies_update_maximum_set_gen.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/RetentionPolicies_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py index beb891aebcbe..952da95117af 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,12 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", resource={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/EE9BD735-67CE-4A90-89C4-439D3F6A4C93/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity": {} + }, + }, "location": "northcentralus", "properties": {"ipAllowlist": ["10.0.0.0/8"], "sku": {"name": "Dedicated"}}, "tags": {"department": "research", "development": "true"}, @@ -42,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py index 97e88de7bc3a..1ecca2392c29 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/Schedulers_Delete.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py index 984e5c0f16ea..a2c974f3f718 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_Get.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Get.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py index f9ebb33fc3e5..1643bee20653 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Schedulers_ListByResourceGroup.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py index 13415de76658..f6d0ea4ca28d 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/Schedulers_ListBySubscription.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py new file mode 100644 index 000000000000..7599dac0fe6b --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_restart.py @@ -0,0 +1,41 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python schedulers_restart.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.schedulers.restart( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + ) + + +# x-ms-original-file: 2026-07-01-preview/Schedulers_Restart.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py index 2338bcbe2e79..7d2f5d783912 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/schedulers_update.py @@ -34,6 +34,7 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", properties={ + "identity": {"type": "None"}, "properties": {"ipAllowlist": ["10.0.0.0/8"], "sku": {"capacity": 3, "name": "Dedicated"}}, "tags": {"hello": "world"}, }, @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/Schedulers_Update.json +# x-ms-original-file: 2026-07-01-preview/Schedulers_Update.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py index d0109c2be9e9..6b05cd350abe 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_create_or_update.py @@ -34,11 +34,11 @@ def main(): resource_group_name="rgopenapi", scheduler_name="testscheduler", task_hub_name="testtaskhub", - resource={"properties": {}}, + resource={"properties": {"capabilities": ["ExampleFutureCapability"]}}, ).result() print(response) -# x-ms-original-file: 2026-02-01/TaskHubs_CreateOrUpdate.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py index 2aad219c26bc..48ba140f3f7a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-02-01/TaskHubs_Delete.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py index 117a8fec166a..9893b9cdb3fb 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-02-01/TaskHubs_Get.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_Get.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py index 3c72c31ad9ce..d863225880cf 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_hubs_list_by_scheduler.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-02-01/TaskHubs_ListByScheduler.json +# x-ms-original-file: 2026-07-01-preview/TaskHubs_ListByScheduler.json if __name__ == "__main__": main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py new file mode 100644 index 000000000000..192fdb6d1909 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update.py @@ -0,0 +1,45 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_create_or_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + resource={"properties": {"throughput": {"actionsPerSecond": 40}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py new file mode 100644 index 000000000000..d8cd7fe31613 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_create_or_update_minimum_set.py @@ -0,0 +1,45 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_create_or_update_minimum_set.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_create_or_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + resource={"properties": {}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate_MinimumSet.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py new file mode 100644 index 000000000000..b80ba90ea7df --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_delete.py @@ -0,0 +1,43 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.task_queues.begin_delete( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py new file mode 100644 index 000000000000..0c51754dfddb --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_get.py @@ -0,0 +1,44 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.get( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py new file mode 100644 index 000000000000..d0790fa139bc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_list_by_task_hub.py @@ -0,0 +1,44 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_list_by_task_hub.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.list_by_task_hub( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_ListByTaskHub.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py new file mode 100644 index 000000000000..8918683d296a --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/task_queues_update.py @@ -0,0 +1,45 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python task_queues_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.task_queues.begin_update( + resource_group_name="rgopenapi", + scheduler_name="testscheduler", + task_hub_name="testtaskhub", + task_queue_name="QueueA", + properties={"properties": {"throughput": {"actionsPerSecond": 80}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TaskQueues_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py new file mode 100644 index 000000000000..021f04d149bc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_create_or_replace_maximum_set_gen.py @@ -0,0 +1,49 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_create_or_replace_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + resource={ + "properties": { + "autoRotationEnabled": True, + "keySource": "CustomerManaged", + "keyVaultKeyUri": "https://microsoft.com/ap", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_CreateOrReplace_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py new file mode 100644 index 000000000000..ed6261c60b37 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_delete_maximum_set_gen.py @@ -0,0 +1,41 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.transparent_data_encryptions.begin_delete( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ).result() + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py new file mode 100644 index 000000000000..fd53e1a7ca74 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_get_maximum_set_gen.py @@ -0,0 +1,42 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.get( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + print(response) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py new file mode 100644 index 000000000000..62de924bdca2 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_samples/transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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.identity import DefaultAzureCredential + +from azure.mgmt.durabletask import DurableTaskMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-durabletask +# USAGE + python transparent_data_encryptions_list_by_scheduler_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DurableTaskMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.transparent_data_encryptions.list_by_scheduler( + resource_group_name="rgdurabletask", + scheduler_name="testscheduler", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_ListByScheduler_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py new file mode 100644 index 000000000000..bb146fedc8c8 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations.py @@ -0,0 +1,42 @@ +# 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 azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtDetectorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_detectors_get(self, resource_group): + response = self.client.detectors.get( + resource_group_name=resource_group.name, + scheduler_name="str", + detector_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_detectors_list_by_scheduler(self, resource_group): + response = self.client.detectors.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py new file mode 100644 index 000000000000..a0c3501947cc --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_detectors_operations_async.py @@ -0,0 +1,43 @@ +# 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 azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtDetectorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_detectors_get(self, resource_group): + response = await self.client.detectors.get( + resource_group_name=resource_group.name, + scheduler_name="str", + detector_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_detectors_list_by_scheduler(self, resource_group): + response = self.client.detectors.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py new file mode 100644 index 000000000000..100682d5baea --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations.py @@ -0,0 +1,105 @@ +# 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 azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtFailoverInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_get(self, resource_group): + response = self.client.failover_instances.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_create_or_replace(self, resource_group): + response = self.client.failover_instances.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "partnerSchedulerResourceId": "str", + "failoverState": "str", + "partnerSchedulerLocation": "str", + "provisioningState": "str", + "replicationRole": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_delete(self, resource_group): + response = self.client.failover_instances.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_list_by_scheduler(self, resource_group): + response = self.client.failover_instances.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_failover(self, resource_group): + response = self.client.failover_instances.begin_failover( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_instances_begin_force_failover_allow_data_loss(self, resource_group): + response = self.client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py new file mode 100644 index 000000000000..ee616e089643 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_failover_instances_operations_async.py @@ -0,0 +1,114 @@ +# 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 azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtFailoverInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_get(self, resource_group): + response = await self.client.failover_instances.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.failover_instances.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "partnerSchedulerResourceId": "str", + "failoverState": "str", + "partnerSchedulerLocation": "str", + "provisioningState": "str", + "replicationRole": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_delete(self, resource_group): + response = await ( + await self.client.failover_instances.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_list_by_scheduler(self, resource_group): + response = self.client.failover_instances.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_failover(self, resource_group): + response = await ( + await self.client.failover_instances.begin_failover( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_instances_begin_force_failover_allow_data_loss(self, resource_group): + response = await ( + await self.client.failover_instances.begin_force_failover_allow_data_loss( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py index 81a9af59bc7c..583b9a8bcff8 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations.py @@ -38,6 +38,12 @@ def test_schedulers_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "ipAllowlist": ["str"], @@ -94,6 +100,12 @@ def test_schedulers_begin_update(self, resource_group): resource_group_name=resource_group.name, scheduler_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "endpoint": "str", "ipAllowlist": ["str"], @@ -251,3 +263,14 @@ def test_schedulers_list_private_endpoint_connections(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_schedulers_restart(self, resource_group): + response = self.client.schedulers.restart( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py index e6418815bf3e..296130c61b94 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_schedulers_operations_async.py @@ -40,6 +40,12 @@ async def test_schedulers_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "ipAllowlist": ["str"], @@ -98,6 +104,12 @@ async def test_schedulers_begin_update(self, resource_group): resource_group_name=resource_group.name, scheduler_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "endpoint": "str", "ipAllowlist": ["str"], @@ -264,3 +276,14 @@ async def test_schedulers_list_private_endpoint_connections(self, resource_group result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_schedulers_restart(self, resource_group): + response = await self.client.schedulers.restart( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py index 5493ac320100..825bf0fa5090 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations.py @@ -40,7 +40,7 @@ def test_task_hubs_begin_create_or_update(self, resource_group): resource={ "id": "str", "name": "str", - "properties": {"dashboardUrl": "str", "provisioningState": "str"}, + "properties": {"capabilities": ["str"], "dashboardUrl": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py index c345f405a6fc..4491e1ee0191 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_hubs_operations_async.py @@ -42,7 +42,7 @@ async def test_task_hubs_begin_create_or_update(self, resource_group): resource={ "id": "str", "name": "str", - "properties": {"dashboardUrl": "str", "provisioningState": "str"}, + "properties": {"capabilities": ["str"], "dashboardUrl": "str", "provisioningState": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py new file mode 100644 index 000000000000..6d672190401c --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations.py @@ -0,0 +1,98 @@ +# 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 azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTaskQueuesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_get(self, resource_group): + response = self.client.task_queues.get( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_create_or_update(self, resource_group): + response = self.client.task_queues.begin_create_or_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_update(self, resource_group): + response = self.client.task_queues.begin_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + properties={"properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_begin_delete(self, resource_group): + response = self.client.task_queues.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_task_queues_list_by_task_hub(self, resource_group): + response = self.client.task_queues.list_by_task_hub( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py new file mode 100644 index 000000000000..abb160991551 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_task_queues_operations_async.py @@ -0,0 +1,105 @@ +# 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 azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTaskQueuesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_get(self, resource_group): + response = await self.client.task_queues.get( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_create_or_update(self, resource_group): + response = await ( + await self.client.task_queues.begin_create_or_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + resource={ + "id": "str", + "name": "str", + "properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_update(self, resource_group): + response = await ( + await self.client.task_queues.begin_update( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + properties={"properties": {"provisioningState": "str", "throughput": {"actionsPerSecond": 0}}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_begin_delete(self, resource_group): + response = await ( + await self.client.task_queues.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + task_queue_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_task_queues_list_by_task_hub(self, resource_group): + response = self.client.task_queues.list_by_task_hub( + resource_group_name=resource_group.name, + scheduler_name="str", + task_hub_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py new file mode 100644 index 000000000000..6282b5e8c988 --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations.py @@ -0,0 +1,82 @@ +# 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 azure.mgmt.durabletask import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTransparentDataEncryptionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_get(self, resource_group): + response = self.client.transparent_data_encryptions.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_create_or_replace(self, resource_group): + response = self.client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "keySource": "str", + "autoRotationEnabled": bool, + "keyVaultKeyUri": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_delete(self, resource_group): + response = self.client.transparent_data_encryptions.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_list_by_scheduler(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py new file mode 100644 index 000000000000..2b58c6610e8c --- /dev/null +++ b/sdk/durabletask/azure-mgmt-durabletask/generated_tests/test_durable_task_mgmt_transparent_data_encryptions_operations_async.py @@ -0,0 +1,87 @@ +# 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 azure.mgmt.durabletask.aio import DurableTaskMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDurableTaskMgmtTransparentDataEncryptionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DurableTaskMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_get(self, resource_group): + response = await self.client.transparent_data_encryptions.get( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_create_or_replace( + resource_group_name=resource_group.name, + scheduler_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "keySource": "str", + "autoRotationEnabled": bool, + "keyVaultKeyUri": "str", + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_delete(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_delete( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_list_by_scheduler(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_scheduler( + resource_group_name=resource_group.name, + scheduler_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml b/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml index 1f7687cf95b6..f2b328fa5732 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml +++ b/sdk/durabletask/azure-mgmt-durabletask/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Durabletask Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -77,7 +77,7 @@ package_name = "azure-mgmt-durabletask" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Durabletask Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml index 88b0416152cb..4b6f525d16ef 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml +++ b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/durabletask/DurableTask.Management -commit: a86317f00c71ef51aab7f78e6f4a2be3cf58f2cd +directory: specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask +commit: d218330c5a3b727df9504ba852e97259479e8fef repo: Azure/azure-rest-api-specs additionalDirectories: From 88753c4cc1abc414d977234bba7bb826b55915ff Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:44:13 +0800 Subject: [PATCH 2/4] Update CHANGELOG.md --- sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md index e26e3bc70565..c70a0b729894 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md @@ -36,7 +36,7 @@ - Added enum `TransparentDataEncryptionKeySource` - Added model `TransparentDataEncryptionProperties` - Added model `UserAssignedIdentity` - - Model `SchedulersOperations` added method `restart` + - Operation group `SchedulersOperations` added method `restart` - Added operation group `DetectorsOperations` - Added operation group `FailoverInstancesOperations` - Added operation group `TaskQueuesOperations` From 86f39c34726eaa882e2472ea529d624d4335ef8a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 20 Oct 2026 02:15:32 +0000 Subject: [PATCH 3/4] Configurations: 'specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask/tspconfig.yaml', and CommitSHA: 'f1f796502a81c1cf4d44fe97109e8a71fe8ba485' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6977093 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md | 4 ++-- sdk/durabletask/azure-mgmt-durabletask/_metadata.json | 2 +- .../azure-mgmt-durabletask/apiview-properties.json | 2 +- sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md index c70a0b729894..3296a0a9e02a 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0b1 (2026-10-15) +## 1.2.0b1 (2026-10-20) ### Features Added @@ -36,7 +36,7 @@ - Added enum `TransparentDataEncryptionKeySource` - Added model `TransparentDataEncryptionProperties` - Added model `UserAssignedIdentity` - - Operation group `SchedulersOperations` added method `restart` + - Model `SchedulersOperations` added method `restart` - Added operation group `DetectorsOperations` - Added operation group `FailoverInstancesOperations` - Added operation group `TaskQueuesOperations` diff --git a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json index 1c61ae5840d8..083d4471a81b 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/_metadata.json +++ b/sdk/durabletask/azure-mgmt-durabletask/_metadata.json @@ -3,7 +3,7 @@ "apiVersions": { "Microsoft.DurableTask": "2026-07-01-preview" }, - "commit": "d218330c5a3b727df9504ba852e97259479e8fef", + "commit": "f1f796502a81c1cf4d44fe97109e8a71fe8ba485", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask", "emitterVersion": "0.63.10", diff --git a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json index 3353f4127e8f..9d611cdaae23 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json +++ b/sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json @@ -147,5 +147,5 @@ "azure.mgmt.durabletask.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss", "azure.mgmt.durabletask.aio.operations.FailoverInstancesOperations.begin_force_failover_allow_data_loss": "Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss" }, - "CrossLanguageVersion": "cbc588f0f984" + "CrossLanguageVersion": "1df18bc0d591" } \ No newline at end of file diff --git a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml index 4b6f525d16ef..83acb22e0796 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml +++ b/sdk/durabletask/azure-mgmt-durabletask/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask -commit: d218330c5a3b727df9504ba852e97259479e8fef +commit: f1f796502a81c1cf4d44fe97109e8a71fe8ba485 repo: Azure/azure-rest-api-specs additionalDirectories: From f61b4c257fe38b89853910ae163b941c6aca0cfa Mon Sep 17 00:00:00 2001 From: Chenxi Jiang <119990644+ChenxiJiang333@users.noreply.github.com> Date: Tue, 20 Oct 2026 10:38:10 +0800 Subject: [PATCH 4/4] Update CHANGELOG.md --- sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md index 3296a0a9e02a..8d6de7473856 100644 --- a/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md @@ -36,7 +36,7 @@ - Added enum `TransparentDataEncryptionKeySource` - Added model `TransparentDataEncryptionProperties` - Added model `UserAssignedIdentity` - - Model `SchedulersOperations` added method `restart` + - Operation group `SchedulersOperations` added method `restart` - Added operation group `DetectorsOperations` - Added operation group `FailoverInstancesOperations` - Added operation group `TaskQueuesOperations`