Skip to content

Commit

Permalink
CodeGen from PR 24011 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 26675d46603b8561db2ba67ed5514e406f5759f5 into c183bb012de8e9e1d0d2e67a0994748df4747d2c
  • Loading branch information
SDKAuto committed May 23, 2023
1 parent 5f83dad commit 4f8e7bf
Show file tree
Hide file tree
Showing 118 changed files with 2,716 additions and 985 deletions.
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": "8dee0079c59ccc73e27a91f23620bf44de10f08d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.0",
"@autorest/python@6.4.12",
"@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.12 --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
:keyword api_version: Api Version. Default value is "2023-05-01". 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-05-01")

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 @@ -23,6 +23,7 @@
DataProtectionOperations,
DataProtectionOperationsOperations,
DeletedBackupInstancesOperations,
DppResourceGuardProxyOperations,
ExportJobsOperationResultOperations,
ExportJobsOperations,
JobsOperations,
Expand Down Expand Up @@ -86,13 +87,16 @@ 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
:keyword api_version: Api Version. Default value is "2023-05-01". 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
Expand All @@ -109,7 +113,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 @@ -152,6 +156,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
:keyword api_version: Api Version. Default value is "2023-05-01". 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-05-01")

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 @@ -23,6 +23,7 @@
DataProtectionOperations,
DataProtectionOperationsOperations,
DeletedBackupInstancesOperations,
DppResourceGuardProxyOperations,
ExportJobsOperationResultOperations,
ExportJobsOperations,
JobsOperations,
Expand Down Expand Up @@ -86,13 +87,16 @@ 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
:keyword api_version: Api Version. Default value is "2023-05-01". 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
Expand All @@ -109,7 +113,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 @@ -152,6 +156,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 @@ -23,6 +23,7 @@
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 @@ -46,6 +47,7 @@
"ExportJobsOperationResultOperations",
"DeletedBackupInstancesOperations",
"ResourceGuardsOperations",
"DppResourceGuardProxyOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Loading

0 comments on commit 4f8e7bf

Please sign in to comment.