Skip to content

Commit 13848aa

Browse files
author
SDKAuto
committed
CodeGen from PR 23391 in Azure/azure-rest-api-specs
Merge c29c3af3575c186243324bbcf5345120e02775ec into 06dbe269f7d9c709cc225c92358b38c3c2b74d60
1 parent 4f495d9 commit 13848aa

File tree

130 files changed

+5827
-940
lines changed

Some content is hidden

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

130 files changed

+5827
-940
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "96c583e9d5d09c51fe8a21843180c51b98b4a7db",
2+
"commit": "41dbe1b317caf6cea2185ff0800d719ffcf8e8a4",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/python@6.4.0",
6+
"@autorest/python@6.4.7",
77
"@autorest/modelerfour@4.24.3"
88
],
9-
"autorest_command": "autorest specification/dataprotection/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/dataprotection/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/dataprotection/resource-manager/readme.md"
1111
}

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from ._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials import TokenCredential
@@ -35,14 +29,14 @@ class DataProtectionMgmtClientConfiguration(Configuration): # pylint: disable=t
3529
:type credential: ~azure.core.credentials.TokenCredential
3630
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3731
:type subscription_id: str
38-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
39-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
4034
:paramtype api_version: str
4135
"""
4236

4337
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataProtectionMgmtClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2023-01-01"] = kwargs.pop("api_version", "2023-01-01")
39+
api_version: str = kwargs.pop("api_version", "2023-04-01-preview")
4640

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

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_mgmt_client.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
from ._configuration import DataProtectionMgmtClientConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
19+
BackupInstancesExtensionRoutingOperations,
1920
BackupInstancesOperations,
2021
BackupPoliciesOperations,
2122
BackupVaultOperationResultsOperations,
2223
BackupVaultsOperations,
24+
DataProtectionMgmtClientOperationsMixin,
2325
DataProtectionOperations,
2426
DataProtectionOperationsOperations,
2527
DeletedBackupInstancesOperations,
28+
DppResourceGuardProxyOperations,
2629
ExportJobsOperationResultOperations,
2730
ExportJobsOperations,
2831
JobsOperations,
@@ -40,7 +43,9 @@
4043
from azure.core.credentials import TokenCredential
4144

4245

43-
class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
46+
class DataProtectionMgmtClient(
47+
DataProtectionMgmtClientOperationsMixin
48+
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4449
"""Open API 2.0 Specs for Azure Data Protection service.
4550
4651
:ivar backup_vaults: BackupVaultsOperations operations
@@ -71,6 +76,9 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
7176
:vartype backup_instances: azure.mgmt.dataprotection.operations.BackupInstancesOperations
7277
:ivar recovery_points: RecoveryPointsOperations operations
7378
:vartype recovery_points: azure.mgmt.dataprotection.operations.RecoveryPointsOperations
79+
:ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
80+
:vartype backup_instances_extension_routing:
81+
azure.mgmt.dataprotection.operations.BackupInstancesExtensionRoutingOperations
7482
:ivar jobs: JobsOperations operations
7583
:vartype jobs: azure.mgmt.dataprotection.operations.JobsOperations
7684
:ivar restorable_time_ranges: RestorableTimeRangesOperations operations
@@ -86,14 +94,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
8694
azure.mgmt.dataprotection.operations.DeletedBackupInstancesOperations
8795
:ivar resource_guards: ResourceGuardsOperations operations
8896
:vartype resource_guards: azure.mgmt.dataprotection.operations.ResourceGuardsOperations
97+
:ivar dpp_resource_guard_proxy: DppResourceGuardProxyOperations operations
98+
:vartype dpp_resource_guard_proxy:
99+
azure.mgmt.dataprotection.operations.DppResourceGuardProxyOperations
89100
:param credential: Credential needed for the client to connect to Azure. Required.
90101
:type credential: ~azure.core.credentials.TokenCredential
91102
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
92103
:type subscription_id: str
93104
:param base_url: Service URL. Default value is "https://management.azure.com".
94105
:type base_url: str
95-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
96-
default value may result in unsupported behavior.
106+
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
107+
this default value may result in unsupported behavior.
97108
:paramtype api_version: str
98109
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
99110
Retry-After header is present.
@@ -109,7 +120,7 @@ def __init__(
109120
self._config = DataProtectionMgmtClientConfiguration(
110121
credential=credential, subscription_id=subscription_id, **kwargs
111122
)
112-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
123+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
113124

114125
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
115126
self._serialize = Serializer(client_models)
@@ -140,6 +151,9 @@ def __init__(
140151
self._client, self._config, self._serialize, self._deserialize
141152
)
142153
self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize)
154+
self.backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations(
155+
self._client, self._config, self._serialize, self._deserialize
156+
)
143157
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
144158
self.restorable_time_ranges = RestorableTimeRangesOperations(
145159
self._client, self._config, self._serialize, self._deserialize
@@ -152,6 +166,9 @@ def __init__(
152166
self._client, self._config, self._serialize, self._deserialize
153167
)
154168
self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize)
169+
self.dpp_resource_guard_proxy = DppResourceGuardProxyOperations(
170+
self._client, self._config, self._serialize, self._deserialize
171+
)
155172

156173
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
157174
"""Runs the network request through the client's chained policies.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
629629
if xml_desc.get("attr", False):
630630
if xml_ns:
631631
ET.register_namespace(xml_prefix, xml_ns)
632-
xml_name = "{}{}".format(xml_ns, xml_name)
632+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
633633
serialized.set(xml_name, new_attr) # type: ignore
634634
continue
635635
if xml_desc.get("text", False):
@@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
12711271
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12721272
xml_ns = internal_type_xml_map.get("ns", None)
12731273
if xml_ns:
1274-
xml_name = "{}{}".format(xml_ns, xml_name)
1274+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12751275
return xml_name
12761276

12771277

@@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data):
12951295
# Integrate namespace if necessary
12961296
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
12971297
if xml_ns:
1298-
xml_name = "{}{}".format(xml_ns, xml_name)
1298+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12991299

13001300
# If it's an attribute, that's simple
13011301
if xml_desc.get("attr", False):

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_vendor.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
77

8-
from typing import List, cast
8+
from abc import ABC
9+
from typing import List, TYPE_CHECKING, cast
910

1011
from azure.core.pipeline.transport import HttpRequest
1112

13+
from ._configuration import DataProtectionMgmtClientConfiguration
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core import PipelineClient
18+
19+
from ._serialization import Deserializer, Serializer
20+
1221

1322
def _convert_request(request, files=None):
1423
data = request.content if not files else None
@@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs):
2837
formatted_components = cast(List[str], template.split("/"))
2938
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
3039
template = "/".join(components)
40+
41+
42+
class DataProtectionMgmtClientMixinABC(ABC):
43+
"""DO NOT use this class. It is for internal typing use only."""
44+
45+
_client: "PipelineClient"
46+
_config: DataProtectionMgmtClientConfiguration
47+
_serialize: "Serializer"
48+
_deserialize: "Deserializer"

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_configuration.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from .._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials_async import AsyncTokenCredential
@@ -35,14 +29,14 @@ class DataProtectionMgmtClientConfiguration(Configuration): # pylint: disable=t
3529
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3630
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3731
:type subscription_id: str
38-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
39-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
4034
:paramtype api_version: str
4135
"""
4236

4337
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataProtectionMgmtClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2023-01-01"] = kwargs.pop("api_version", "2023-01-01")
39+
api_version: str = kwargs.pop("api_version", "2023-04-01-preview")
4640

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

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_data_protection_mgmt_client.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
from .._serialization import Deserializer, Serializer
1717
from ._configuration import DataProtectionMgmtClientConfiguration
1818
from .operations import (
19+
BackupInstancesExtensionRoutingOperations,
1920
BackupInstancesOperations,
2021
BackupPoliciesOperations,
2122
BackupVaultOperationResultsOperations,
2223
BackupVaultsOperations,
24+
DataProtectionMgmtClientOperationsMixin,
2325
DataProtectionOperations,
2426
DataProtectionOperationsOperations,
2527
DeletedBackupInstancesOperations,
28+
DppResourceGuardProxyOperations,
2629
ExportJobsOperationResultOperations,
2730
ExportJobsOperations,
2831
JobsOperations,
@@ -40,7 +43,9 @@
4043
from azure.core.credentials_async import AsyncTokenCredential
4144

4245

43-
class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
46+
class DataProtectionMgmtClient(
47+
DataProtectionMgmtClientOperationsMixin
48+
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4449
"""Open API 2.0 Specs for Azure Data Protection service.
4550
4651
:ivar backup_vaults: BackupVaultsOperations operations
@@ -71,6 +76,9 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
7176
:vartype backup_instances: azure.mgmt.dataprotection.aio.operations.BackupInstancesOperations
7277
:ivar recovery_points: RecoveryPointsOperations operations
7378
:vartype recovery_points: azure.mgmt.dataprotection.aio.operations.RecoveryPointsOperations
79+
:ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
80+
:vartype backup_instances_extension_routing:
81+
azure.mgmt.dataprotection.aio.operations.BackupInstancesExtensionRoutingOperations
7482
:ivar jobs: JobsOperations operations
7583
:vartype jobs: azure.mgmt.dataprotection.aio.operations.JobsOperations
7684
:ivar restorable_time_ranges: RestorableTimeRangesOperations operations
@@ -86,14 +94,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
8694
azure.mgmt.dataprotection.aio.operations.DeletedBackupInstancesOperations
8795
:ivar resource_guards: ResourceGuardsOperations operations
8896
:vartype resource_guards: azure.mgmt.dataprotection.aio.operations.ResourceGuardsOperations
97+
:ivar dpp_resource_guard_proxy: DppResourceGuardProxyOperations operations
98+
:vartype dpp_resource_guard_proxy:
99+
azure.mgmt.dataprotection.aio.operations.DppResourceGuardProxyOperations
89100
:param credential: Credential needed for the client to connect to Azure. Required.
90101
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
91102
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
92103
:type subscription_id: str
93104
:param base_url: Service URL. Default value is "https://management.azure.com".
94105
:type base_url: str
95-
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
96-
default value may result in unsupported behavior.
106+
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
107+
this default value may result in unsupported behavior.
97108
:paramtype api_version: str
98109
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
99110
Retry-After header is present.
@@ -109,7 +120,7 @@ def __init__(
109120
self._config = DataProtectionMgmtClientConfiguration(
110121
credential=credential, subscription_id=subscription_id, **kwargs
111122
)
112-
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
123+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
113124

114125
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
115126
self._serialize = Serializer(client_models)
@@ -140,6 +151,9 @@ def __init__(
140151
self._client, self._config, self._serialize, self._deserialize
141152
)
142153
self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize)
154+
self.backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations(
155+
self._client, self._config, self._serialize, self._deserialize
156+
)
143157
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
144158
self.restorable_time_ranges = RestorableTimeRangesOperations(
145159
self._client, self._config, self._serialize, self._deserialize
@@ -152,6 +166,9 @@ def __init__(
152166
self._client, self._config, self._serialize, self._deserialize
153167
)
154168
self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize)
169+
self.dpp_resource_guard_proxy = DppResourceGuardProxyOperations(
170+
self._client, self._config, self._serialize, self._deserialize
171+
)
155172

156173
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
157174
"""Runs the network request through the client's chained policies.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------
7+
8+
from abc import ABC
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.pipeline.transport import HttpRequest
12+
13+
from ._configuration import DataProtectionMgmtClientConfiguration
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core import AsyncPipelineClient
18+
19+
from .._serialization import Deserializer, Serializer
20+
21+
22+
class DataProtectionMgmtClientMixinABC(ABC):
23+
"""DO NOT use this class. It is for internal typing use only."""
24+
25+
_client: "AsyncPipelineClient"
26+
_config: DataProtectionMgmtClientConfiguration
27+
_serialize: "Serializer"
28+
_deserialize: "Deserializer"

sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
from ._backup_policies_operations import BackupPoliciesOperations
1818
from ._backup_instances_operations import BackupInstancesOperations
1919
from ._recovery_points_operations import RecoveryPointsOperations
20+
from ._data_protection_mgmt_client_operations import DataProtectionMgmtClientOperationsMixin
21+
from ._backup_instances_extension_routing_operations import BackupInstancesExtensionRoutingOperations
2022
from ._jobs_operations import JobsOperations
2123
from ._restorable_time_ranges_operations import RestorableTimeRangesOperations
2224
from ._export_jobs_operations import ExportJobsOperations
2325
from ._export_jobs_operation_result_operations import ExportJobsOperationResultOperations
2426
from ._deleted_backup_instances_operations import DeletedBackupInstancesOperations
2527
from ._resource_guards_operations import ResourceGuardsOperations
28+
from ._dpp_resource_guard_proxy_operations import DppResourceGuardProxyOperations
2629

2730
from ._patch import __all__ as _patch_all
2831
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -40,12 +43,15 @@
4043
"BackupPoliciesOperations",
4144
"BackupInstancesOperations",
4245
"RecoveryPointsOperations",
46+
"DataProtectionMgmtClientOperationsMixin",
47+
"BackupInstancesExtensionRoutingOperations",
4348
"JobsOperations",
4449
"RestorableTimeRangesOperations",
4550
"ExportJobsOperations",
4651
"ExportJobsOperationResultOperations",
4752
"DeletedBackupInstancesOperations",
4853
"ResourceGuardsOperations",
54+
"DppResourceGuardProxyOperations",
4955
]
5056
__all__.extend([p for p in _patch_all if p not in __all__])
5157
_patch_sdk()

0 commit comments

Comments
 (0)