Skip to content

Commit 40b1b38

Browse files
author
SDKAuto
committed
CodeGen from PR 33844 in Azure/azure-rest-api-specs
Merge 7cddd8a69898de66cc3c2197a684b0ee2e17ed2c into d851eaf017961d36e354b15147664660e537a196
1 parent 6baefbc commit 40b1b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2580
-94
lines changed

sdk/durabletask/azure-mgmt-durabletask/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Release History
22

3+
## 1.0.0b2 (2025-04-09)
4+
5+
### Features Added
6+
7+
- Client `DurableTaskMgmtClient` added operation group `retention_policies`
8+
- Added enum `PurgeableOrchestrationState`
9+
- Added model `RetentionPolicy`
10+
- Added model `RetentionPolicyDetails`
11+
- Added model `RetentionPolicyProperties`
12+
- Added model `RetentionPoliciesOperations`
13+
- Method `RetentionPolicy.__init__` has a new overload `def __init__(self: None, properties: Optional[_models.RetentionPolicyProperties])`
14+
- Method `RetentionPolicy.__init__` has a new overload `def __init__(self: None, mapping: Mapping[str, Any])`
15+
- Method `RetentionPolicyDetails.__init__` has a new overload `def __init__(self: None, retention_period_in_days: int, orchestration_state: Optional[Union[str, _models.PurgeableOrchestrationState]])`
16+
- Method `RetentionPolicyDetails.__init__` has a new overload `def __init__(self: None, mapping: Mapping[str, Any])`
17+
- Method `RetentionPolicyProperties.__init__` has a new overload `def __init__(self: None, retention_policies: Optional[List[_models.RetentionPolicyDetails]])`
18+
- Method `RetentionPolicyProperties.__init__` has a new overload `def __init__(self: None, mapping: Mapping[str, Any])`
19+
- Method `RetentionPoliciesOperations.begin_create_or_replace` has a new overload `def begin_create_or_replace(self: None, resource_group_name: str, scheduler_name: str, resource: RetentionPolicy, content_type: str)`
20+
- Method `RetentionPoliciesOperations.begin_create_or_replace` has a new overload `def begin_create_or_replace(self: None, resource_group_name: str, scheduler_name: str, resource: JSON, content_type: str)`
21+
- Method `RetentionPoliciesOperations.begin_create_or_replace` has a new overload `def begin_create_or_replace(self: None, resource_group_name: str, scheduler_name: str, resource: IO[bytes], content_type: str)`
22+
- Method `RetentionPoliciesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, scheduler_name: str, properties: RetentionPolicy, content_type: str)`
23+
- Method `RetentionPoliciesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, scheduler_name: str, properties: JSON, content_type: str)`
24+
- Method `RetentionPoliciesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, scheduler_name: str, properties: IO[bytes], content_type: str)`
25+
326
## 1.0.0b1 (2025-03-25)
427

528
### Other Changes

sdk/durabletask/azure-mgmt-durabletask/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "7b8c7b5a83ea874d6edf8f01d44bd923a664f31e",
2+
"commit": "3cf57cdcc1d2cba7860509a443ff824b8b5d22b4",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/durabletask/DurableTask.Management",
5-
"@azure-tools/typespec-python": "0.39.1"
5+
"@azure-tools/typespec-python": "0.42.2"
66
}

sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"azure.mgmt.durabletask.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
99
"azure.mgmt.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
1010
"azure.mgmt.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
11+
"azure.mgmt.durabletask.models.RetentionPolicy": "Microsoft.DurableTask.RetentionPolicy",
12+
"azure.mgmt.durabletask.models.RetentionPolicyDetails": "Microsoft.DurableTask.RetentionPolicyDetails",
13+
"azure.mgmt.durabletask.models.RetentionPolicyProperties": "Microsoft.DurableTask.RetentionPolicyProperties",
1114
"azure.mgmt.durabletask.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
1215
"azure.mgmt.durabletask.models.Scheduler": "Microsoft.DurableTask.Scheduler",
1316
"azure.mgmt.durabletask.models.SchedulerProperties": "Microsoft.DurableTask.SchedulerProperties",
@@ -23,6 +26,7 @@
2326
"azure.mgmt.durabletask.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
2427
"azure.mgmt.durabletask.models.ProvisioningState": "Microsoft.DurableTask.ProvisioningState",
2528
"azure.mgmt.durabletask.models.RedundancyState": "Microsoft.DurableTask.RedundancyState",
29+
"azure.mgmt.durabletask.models.PurgeableOrchestrationState": "Microsoft.DurableTask.PurgeableOrchestrationState",
2630
"azure.mgmt.durabletask.DurableTaskMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
2731
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.get": "Microsoft.DurableTask.Schedulers.get",
2832
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate",
@@ -33,6 +37,11 @@
3337
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.get": "Microsoft.DurableTask.TaskHubs.get",
3438
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate",
3539
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.begin_delete": "Microsoft.DurableTask.TaskHubs.delete",
36-
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler"
40+
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler",
41+
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.get": "Microsoft.DurableTask.RetentionPolicies.get",
42+
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace",
43+
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_update": "Microsoft.DurableTask.RetentionPolicies.update",
44+
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete",
45+
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler"
3746
}
3847
}

sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from ._configuration import DurableTaskMgmtClientConfiguration
1919
from ._serialization import Deserializer, Serializer
20-
from .operations import Operations, SchedulersOperations, TaskHubsOperations
20+
from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations
2121

2222
if TYPE_CHECKING:
2323
from azure.core.credentials import TokenCredential
@@ -32,14 +32,16 @@ class DurableTaskMgmtClient:
3232
:vartype schedulers: azure.mgmt.durabletask.operations.SchedulersOperations
3333
:ivar task_hubs: TaskHubsOperations operations
3434
:vartype task_hubs: azure.mgmt.durabletask.operations.TaskHubsOperations
35+
:ivar retention_policies: RetentionPoliciesOperations operations
36+
:vartype retention_policies: azure.mgmt.durabletask.operations.RetentionPoliciesOperations
3537
:param credential: Credential used to authenticate requests to the service. Required.
3638
:type credential: ~azure.core.credentials.TokenCredential
3739
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3840
:type subscription_id: str
3941
:param base_url: Service host. Default value is "https://management.azure.com".
4042
:type base_url: str
4143
:keyword api_version: The API version to use for this operation. Default value is
42-
"2024-10-01-preview". Note that overriding this default value may result in unsupported
44+
"2025-04-01-preview". Note that overriding this default value may result in unsupported
4345
behavior.
4446
:paramtype api_version: str
4547
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -83,6 +85,9 @@ def __init__(
8385
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
8486
self.schedulers = SchedulersOperations(self._client, self._config, self._serialize, self._deserialize)
8587
self.task_hubs = TaskHubsOperations(self._client, self._config, self._serialize, self._deserialize)
88+
self.retention_policies = RetentionPoliciesOperations(
89+
self._client, self._config, self._serialize, self._deserialize
90+
)
8691

8792
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
8893
"""Runs the network request through the client's chained policies.

sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a
3030
:param base_url: Service host. Default value is "https://management.azure.com".
3131
:type base_url: str
3232
:keyword api_version: The API version to use for this operation. Default value is
33-
"2024-10-01-preview". Note that overriding this default value may result in unsupported
33+
"2025-04-01-preview". Note that overriding this default value may result in unsupported
3434
behavior.
3535
:paramtype api_version: str
3636
"""
@@ -42,7 +42,7 @@ def __init__(
4242
base_url: str = "https://management.azure.com",
4343
**kwargs: Any
4444
) -> None:
45-
api_version: str = kwargs.pop("api_version", "2024-10-01-preview")
45+
api_version: str = kwargs.pop("api_version", "2025-04-01-preview")
4646

4747
if credential is None:
4848
raise ValueError("Parameter 'credential' must not be None.")

sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_model_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
# Licensed under the MIT License. See License.txt in the project root for
6-
# license information.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
78
# --------------------------------------------------------------------------
89
# pylint: disable=protected-access, broad-except
910

sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

sdk/durabletask/azure-mgmt-durabletask/azure/mgmt/durabletask/_serialization.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# pylint: disable=line-too-long,useless-suppression,too-many-lines
2+
# coding=utf-8
23
# --------------------------------------------------------------------------
3-
#
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
268
# --------------------------------------------------------------------------
279

2810
# pyright: reportUnnecessaryTypeIgnoreComment=false
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) Python Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------
7+
import functools
8+
9+
10+
def api_version_validation(**kwargs):
11+
params_added_on = kwargs.pop("params_added_on", {})
12+
method_added_on = kwargs.pop("method_added_on", "")
13+
14+
def decorator(func):
15+
@functools.wraps(func)
16+
def wrapper(*args, **kwargs):
17+
try:
18+
# this assumes the client has an _api_version attribute
19+
client = args[0]
20+
client_api_version = client._config.api_version # pylint: disable=protected-access
21+
except AttributeError:
22+
return func(*args, **kwargs)
23+
24+
if method_added_on > client_api_version:
25+
raise ValueError(
26+
f"'{func.__name__}' is not available in API version "
27+
f"{client_api_version}. Pass service API version {method_added_on} or newer to your client."
28+
)
29+
30+
unsupported = {
31+
parameter: api_version
32+
for api_version, parameters in params_added_on.items()
33+
for parameter in parameters
34+
if parameter in kwargs and api_version > client_api_version
35+
}
36+
if unsupported:
37+
raise ValueError(
38+
"".join(
39+
[
40+
f"'{param}' is not available in API version {client_api_version}. "
41+
f"Use service API version {version} or newer.\n"
42+
for param, version in unsupported.items()
43+
]
44+
)
45+
)
46+
return func(*args, **kwargs)
47+
48+
return wrapper
49+
50+
return decorator

0 commit comments

Comments
 (0)