Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/dataprotection/azure-mgmt-dataprotection/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "96c583e9d5d09c51fe8a21843180c51b98b4a7db",
"commit": "29ba8a9ed2c638bb209f4b12a791a41d1fe74408",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.0",
"@autorest/python@6.4.8",
"@autorest/modelerfour@4.24.3"
],
"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",
"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.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/dataprotection/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -35,14 +29,14 @@ class DataProtectionMgmtClientConfiguration(Configuration): # pylint: disable=t
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
from ._configuration import DataProtectionMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
BackupInstancesExtensionRoutingOperations,
BackupInstancesOperations,
BackupPoliciesOperations,
BackupVaultOperationResultsOperations,
BackupVaultsOperations,
CrossRegionRestoreJobOperations,
CrossRegionRestoreJobsOperations,
DataProtectionOperations,
DataProtectionOperationsOperations,
DeletedBackupInstancesOperations,
DppResourceGuardProxyOperations,
ExportJobsOperationResultOperations,
ExportJobsOperations,
JobsOperations,
Expand All @@ -33,6 +37,7 @@
RecoveryPointsOperations,
ResourceGuardsOperations,
RestorableTimeRangesOperations,
SecondaryRPsOperations,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -71,6 +76,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
:vartype backup_instances: azure.mgmt.dataprotection.operations.BackupInstancesOperations
:ivar recovery_points: RecoveryPointsOperations operations
:vartype recovery_points: azure.mgmt.dataprotection.operations.RecoveryPointsOperations
:ivar secondary_rps: SecondaryRPsOperations operations
:vartype secondary_rps: azure.mgmt.dataprotection.operations.SecondaryRPsOperations
:ivar cross_region_restore_job: CrossRegionRestoreJobOperations operations
:vartype cross_region_restore_job:
azure.mgmt.dataprotection.operations.CrossRegionRestoreJobOperations
:ivar cross_region_restore_jobs: CrossRegionRestoreJobsOperations operations
:vartype cross_region_restore_jobs:
azure.mgmt.dataprotection.operations.CrossRegionRestoreJobsOperations
:ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
:vartype backup_instances_extension_routing:
azure.mgmt.dataprotection.operations.BackupInstancesExtensionRoutingOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.dataprotection.operations.JobsOperations
:ivar restorable_time_ranges: RestorableTimeRangesOperations operations
Expand All @@ -86,14 +102,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
azure.mgmt.dataprotection.operations.DeletedBackupInstancesOperations
:ivar resource_guards: ResourceGuardsOperations operations
:vartype resource_guards: azure.mgmt.dataprotection.operations.ResourceGuardsOperations
:ivar dpp_resource_guard_proxy: DppResourceGuardProxyOperations operations
:vartype dpp_resource_guard_proxy:
azure.mgmt.dataprotection.operations.DppResourceGuardProxyOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand All @@ -109,7 +128,7 @@ def __init__(
self._config = DataProtectionMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down Expand Up @@ -140,6 +159,16 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize)
self.secondary_rps = SecondaryRPsOperations(self._client, self._config, self._serialize, self._deserialize)
self.cross_region_restore_job = CrossRegionRestoreJobOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.cross_region_restore_jobs = CrossRegionRestoreJobsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.restorable_time_ranges = RestorableTimeRangesOperations(
self._client, self._config, self._serialize, self._deserialize
Expand All @@ -152,6 +181,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize)
self.dpp_resource_guard_proxy = DppResourceGuardProxyOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if xml_desc.get("attr", False):
if xml_ns:
ET.register_namespace(xml_prefix, xml_ns)
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
serialized.set(xml_name, new_attr) # type: ignore
continue
if xml_desc.get("text", False):
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name


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

# If it's an attribute, that's simple
if xml_desc.get("attr", False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from .._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -35,14 +29,14 @@ class DataProtectionMgmtClientConfiguration(Configuration): # pylint: disable=t
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
from .._serialization import Deserializer, Serializer
from ._configuration import DataProtectionMgmtClientConfiguration
from .operations import (
BackupInstancesExtensionRoutingOperations,
BackupInstancesOperations,
BackupPoliciesOperations,
BackupVaultOperationResultsOperations,
BackupVaultsOperations,
CrossRegionRestoreJobOperations,
CrossRegionRestoreJobsOperations,
DataProtectionOperations,
DataProtectionOperationsOperations,
DeletedBackupInstancesOperations,
DppResourceGuardProxyOperations,
ExportJobsOperationResultOperations,
ExportJobsOperations,
JobsOperations,
Expand All @@ -33,6 +37,7 @@
RecoveryPointsOperations,
ResourceGuardsOperations,
RestorableTimeRangesOperations,
SecondaryRPsOperations,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -71,6 +76,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
:vartype backup_instances: azure.mgmt.dataprotection.aio.operations.BackupInstancesOperations
:ivar recovery_points: RecoveryPointsOperations operations
:vartype recovery_points: azure.mgmt.dataprotection.aio.operations.RecoveryPointsOperations
:ivar secondary_rps: SecondaryRPsOperations operations
:vartype secondary_rps: azure.mgmt.dataprotection.aio.operations.SecondaryRPsOperations
:ivar cross_region_restore_job: CrossRegionRestoreJobOperations operations
:vartype cross_region_restore_job:
azure.mgmt.dataprotection.aio.operations.CrossRegionRestoreJobOperations
:ivar cross_region_restore_jobs: CrossRegionRestoreJobsOperations operations
:vartype cross_region_restore_jobs:
azure.mgmt.dataprotection.aio.operations.CrossRegionRestoreJobsOperations
:ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
:vartype backup_instances_extension_routing:
azure.mgmt.dataprotection.aio.operations.BackupInstancesExtensionRoutingOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.dataprotection.aio.operations.JobsOperations
:ivar restorable_time_ranges: RestorableTimeRangesOperations operations
Expand All @@ -86,14 +102,17 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
azure.mgmt.dataprotection.aio.operations.DeletedBackupInstancesOperations
:ivar resource_guards: ResourceGuardsOperations operations
:vartype resource_guards: azure.mgmt.dataprotection.aio.operations.ResourceGuardsOperations
:ivar dpp_resource_guard_proxy: DppResourceGuardProxyOperations operations
:vartype dpp_resource_guard_proxy:
azure.mgmt.dataprotection.aio.operations.DppResourceGuardProxyOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand All @@ -109,7 +128,7 @@ def __init__(
self._config = DataProtectionMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down Expand Up @@ -140,6 +159,16 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize)
self.secondary_rps = SecondaryRPsOperations(self._client, self._config, self._serialize, self._deserialize)
self.cross_region_restore_job = CrossRegionRestoreJobOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.cross_region_restore_jobs = CrossRegionRestoreJobsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.restorable_time_ranges = RestorableTimeRangesOperations(
self._client, self._config, self._serialize, self._deserialize
Expand All @@ -152,6 +181,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize)
self.dpp_resource_guard_proxy = DppResourceGuardProxyOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@
from ._backup_policies_operations import BackupPoliciesOperations
from ._backup_instances_operations import BackupInstancesOperations
from ._recovery_points_operations import RecoveryPointsOperations
from ._secondary_rps_operations import SecondaryRPsOperations
from ._cross_region_restore_job_operations import CrossRegionRestoreJobOperations
from ._cross_region_restore_jobs_operations import CrossRegionRestoreJobsOperations
from ._backup_instances_extension_routing_operations import BackupInstancesExtensionRoutingOperations
from ._jobs_operations import JobsOperations
from ._restorable_time_ranges_operations import RestorableTimeRangesOperations
from ._export_jobs_operations import ExportJobsOperations
from ._export_jobs_operation_result_operations import ExportJobsOperationResultOperations
from ._deleted_backup_instances_operations import DeletedBackupInstancesOperations
from ._resource_guards_operations import ResourceGuardsOperations
from ._dpp_resource_guard_proxy_operations import DppResourceGuardProxyOperations

from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
Expand All @@ -40,12 +45,17 @@
"BackupPoliciesOperations",
"BackupInstancesOperations",
"RecoveryPointsOperations",
"SecondaryRPsOperations",
"CrossRegionRestoreJobOperations",
"CrossRegionRestoreJobsOperations",
"BackupInstancesExtensionRoutingOperations",
"JobsOperations",
"RestorableTimeRangesOperations",
"ExportJobsOperations",
"ExportJobsOperationResultOperations",
"DeletedBackupInstancesOperations",
"ResourceGuardsOperations",
"DppResourceGuardProxyOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Loading