Skip to content

Commit

Permalink
CodeGen from PR 25099 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge bcd0f73f55db60f6ef91e77ae4948b2caa9ef62f into 02dce2af9278b8027d12a0885677478f4eb074a4
  • Loading branch information
SDKAuto committed Aug 2, 2023
1 parent f827a54 commit 25ca7c1
Show file tree
Hide file tree
Showing 695 changed files with 61,366 additions and 3,689 deletions.
12 changes: 7 additions & 5 deletions sdk/containerservice/azure-mgmt-containerservice/_meta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"commit": "c8b7a0090e6cd089110c9ed46ef884ebff32c047",
"commit": "3668f9ce6ac79b08387f1662403e1d1394474a99",
"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/containerservice/resource-manager/Microsoft.ContainerService/aks/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/containerservice/resource-manager/Microsoft.ContainerService/aks/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.7.1 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md",
"package-2023-06": "2023-07-21 03:39:44 +0800 e413760a8ba680c5d71dea6a47ce021af5dab6e2 stable/2023-06-01/managedClusters.json",
"package-2023-05": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 stable/2023-05-01/managedClusters.json",
Expand Down Expand Up @@ -68,5 +68,7 @@
"package-2018-08-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2018-08-01-preview/managedClusters.json",
"package-2018-03-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2018-03-31/managedClusters.json",
"package-2019-09-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2019-09-30/openShiftManagedClusters.json",
"package-2017-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2017-07-01/containerService.json"
"package-2017-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2017-07-01/containerService.json",
"package-preview-2023-07": "2023-08-02 10:56:40 +0800 3668f9ce6ac79b08387f1662403e1d1394474a99 preview/2023-07-02-preview/managedClusters.json",
"package-preview-2023-06": "2023-07-29 00:45:15 +0800 0ba477e161eebf61c799f4d64889953c90eae569 preview/2023-06-02-preview/managedClusters.json"
}

Large diffs are not rendered by default.

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
Loading

0 comments on commit 25ca7c1

Please sign in to comment.