Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoRelease] t2-network-2023-08-01-88047(can only be merged by SDK owner) #31400

Merged
merged 3 commits into from
Aug 1, 2023
Merged
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
10 changes: 5 additions & 5 deletions sdk/network/azure-mgmt-network/_meta.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"commit": "23d88533ddfde4d1565a897fe95d42fb0d9333e5",
"commit": "b5f54222a4a925eb0239cd6653ab8b27185195f4",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.6",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.6.0",
"@autorest/python@6.7.1",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/network/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.6.0 --use=@autorest/[email protected] --version=3.9.6 --version-tolerant=False",
"autorest_command": "autorest specification/network/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.7.1 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"readme": "specification/network/resource-manager/readme.md",
"package-2023-02": "2023-06-19 07:26:19 +0530 0b4a0a3f4bfc198df608f373784505e42e248c2c Microsoft.Network/stable/2023-02-01/networkVirtualAppliance.json",
"package-2021-02": "2021-09-14 19:30:27 -0700 54f1c87938269d4706629dc04c26ee1f3634585a Microsoft.Network/stable/2021-02-01/privateLinkService.json",
"package-2021-02-preview-only": "2023-01-30 13:51:32 +0530 18e83e24c36eed85a240103b476de0220ace7f84 Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json",
"package-2021-02-preview-only": "2023-07-28 22:13:42 +0530 1fbe3900e67f81f96ec4bcf8e5065f8486225035 Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json",
"package-2020-11": "2022-06-05 17:57:39 -0700 afd092f0148242079f0206329e4964407fe9e5b5 Microsoft.Network/stable/2020-11-01/loadBalancer.json",
"package-2020-08": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-08-01/applicationGateway.json",
"package-2020-07": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-07-01/applicationGateway.json",
Expand Down
32 changes: 0 additions & 32 deletions sdk/network/azure-mgmt-network/azure/mgmt/network/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@
NspAccessRulesReconcileOperations,
NspAssociationReconcileOperations,
NspAssociationsOperations,
NspLinkReconcileOperations,
NspLinkReferenceReconcileOperations,
NspLinkReferencesOperations,
NspLinksOperations,
NspProfilesOperations,
Expand Down Expand Up @@ -233,8 +231,6 @@ class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiCl
'nsp_access_rules_reconcile': '2021-02-01-preview',
'nsp_association_reconcile': '2021-02-01-preview',
'nsp_associations': '2021-02-01-preview',
'nsp_link_reconcile': '2021-02-01-preview',
'nsp_link_reference_reconcile': '2021-02-01-preview',
'nsp_link_references': '2021-02-01-preview',
'nsp_links': '2021-02-01-preview',
'nsp_profiles': '2021-02-01-preview',
Expand Down Expand Up @@ -2067,34 +2063,6 @@ def nsp_associations(self):
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
)
def nsp_link_reconcile(self):
api_version = self._get_api_version("nsp_link_reconcile")
return NspLinkReconcileOperations(
self._client,
self._config,
Serializer(self._models_dict()),
Deserializer(self._models_dict()),
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
)
def nsp_link_reference_reconcile(self):
api_version = self._get_api_version("nsp_link_reference_reconcile")
return NspLinkReferenceReconcileOperations(
self._client,
self._config,
Serializer(self._models_dict()),
Deserializer(self._models_dict()),
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
_serialized.update(_new_attr) # type: ignore
_new_attr = _new_attr[k] # type: ignore
_serialized = _serialized[k]
except ValueError:
continue
except ValueError as err:
if isinstance(err, SerializationError):
raise

except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
Expand Down Expand Up @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs):

:param data: The data to be serialized.
:param str data_type: The type to be serialized from.
:keyword bool skip_quote: Whether to skip quote the serialized result.
Defaults to False.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
Expand All @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs):
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
if not kwargs.get("skip_quote", False):
data = [quote(str(d), safe="") for d in data]
return str(self.serialize_iter(data, internal_data_type, **kwargs))
do_quote = not kwargs.get('skip_quote', False)
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))

# Not a list, regular serialization
output = self.serialize_data(data, data_type, **kwargs)
Expand Down Expand Up @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
"""
if isinstance(data, str):
Expand All @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
for d in data:
try:
serialized.append(self.serialize_data(d, iter_type, **kwargs))
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized.append(None)

if kwargs.get('do_quote', False):
serialized = [
'' if s is None else quote(str(s), safe='')
for s
in serialized
]

if div:
serialized = ["" if s is None else str(s) for s in serialized]
serialized = div.join(serialized)
Expand Down Expand Up @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
for key, value in attr.items():
try:
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized[self.serialize_unicode(key)] = None

if "xml" in serialization_ctxt:
Expand Down
14 changes: 1 addition & 13 deletions sdk/network/azure-mgmt-network/azure/mgmt/network/_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --------------------------------------------------------------------------

from abc import ABC
from typing import List, TYPE_CHECKING, cast
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

Expand All @@ -27,18 +27,6 @@ def _convert_request(request, files=None):
return request


def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
try:
return template.format(**kwargs)
except KeyError as key:
# Need the cast, as for some reasons "split" is typed as list[str | Any]
formatted_components = cast(List[str], template.split("/"))
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)


class NetworkManagementClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

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 = "24.0.0"
VERSION = "25.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@
NspAccessRulesReconcileOperations,
NspAssociationReconcileOperations,
NspAssociationsOperations,
NspLinkReconcileOperations,
NspLinkReferenceReconcileOperations,
NspLinkReferencesOperations,
NspLinksOperations,
NspProfilesOperations,
Expand Down Expand Up @@ -233,8 +231,6 @@ class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiCl
'nsp_access_rules_reconcile': '2021-02-01-preview',
'nsp_association_reconcile': '2021-02-01-preview',
'nsp_associations': '2021-02-01-preview',
'nsp_link_reconcile': '2021-02-01-preview',
'nsp_link_reference_reconcile': '2021-02-01-preview',
'nsp_link_references': '2021-02-01-preview',
'nsp_links': '2021-02-01-preview',
'nsp_profiles': '2021-02-01-preview',
Expand Down Expand Up @@ -2067,34 +2063,6 @@ def nsp_associations(self):
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
)
def nsp_link_reconcile(self):
api_version = self._get_api_version("nsp_link_reconcile")
return NspLinkReconcileOperations(
self._client,
self._config,
Serializer(self._models_dict()),
Deserializer(self._models_dict()),
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
)
def nsp_link_reference_reconcile(self):
api_version = self._get_api_version("nsp_link_reference_reconcile")
return NspLinkReferenceReconcileOperations(
self._client,
self._config,
Serializer(self._models_dict()),
Deserializer(self._models_dict()),
api_version=api_version,
)

@property
@api_version_validation(
method_valid_on=['2021-02-01-preview']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@
NspAccessRulesReconcileOperations,
NspAssociationReconcileOperations,
NspAssociationsOperations,
NspLinkReconcileOperations,
NspLinkReferenceReconcileOperations,
NspLinkReferencesOperations,
NspLinksOperations,
NspProfilesOperations,
Expand Down Expand Up @@ -299,8 +297,6 @@
"NspAccessRulesReconcileOperations",
"NspAssociationReconcileOperations",
"NspAssociationsOperations",
"NspLinkReconcileOperations",
"NspLinkReferenceReconcileOperations",
"NspLinkReferencesOperations",
"NspLinksOperations",
"NspProfilesOperations",
Expand Down
Loading