Skip to content

Commit

Permalink
CodeGen from PR 32248 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ee283c9790314900a01c2f0f4c2004c284e8c635 into a1fd6426189e0dd5129eec6aea8d9788fa02bd33
  • Loading branch information
SDKAuto committed Jan 22, 2025
1 parent 523fe37 commit a93ae58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
return ET.Element(tag)


class Model(object):
class Model:
"""Mixin for all client request body/response body models to support
serialization and deserialization.
"""
Expand Down Expand Up @@ -563,7 +563,7 @@ def _decode_attribute_map_key(key):
return key.replace("\\.", ".")


class Serializer(object): # pylint: disable=too-many-public-methods
class Serializer: # pylint: disable=too-many-public-methods
"""Request object model serializer."""

basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
Expand Down Expand Up @@ -1441,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
return children[0]


class Deserializer(object):
class Deserializer:
"""Response object model deserializer.
:param dict classes: Class type dictionary for deserializing complex types.
Expand Down Expand Up @@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
subtype = getattr(response, "_subtype_map", {})
try:
readonly = [
k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
k
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
if v.get("readonly")
]
const = [
k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
k
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
if v.get("constant")
]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
response_obj.additional_properties = additional_properties
response_obj.additional_properties = additional_properties # type: ignore
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
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 = "28.1.0"
VERSION = "28.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -3748,7 +3748,7 @@ class ApplicationGatewayOnDemandProbe(_serialization.Model):
:ivar host: Host name to send the probe to.
:vartype host: str
:ivar path: Relative path of probe. Valid path starts from '/'. Probe is sent to
:code:`<Protocol>`://:code:`<host>`::code:`<port>`:code:`<path>`.
:code:`<Protocol>`://\\ :code:`<host>`:\\ :code:`<port>`\\ :code:`<path>`.
:vartype path: str
:ivar timeout: The probe timeout in seconds. Probe marked as failed if valid response is not
received with this timeout period. Acceptable values are from 1 second to 86400 seconds.
Expand Down Expand Up @@ -3797,7 +3797,7 @@ def __init__(
:keyword host: Host name to send the probe to.
:paramtype host: str
:keyword path: Relative path of probe. Valid path starts from '/'. Probe is sent to
:code:`<Protocol>`://:code:`<host>`::code:`<port>`:code:`<path>`.
:code:`<Protocol>`://\\ :code:`<host>`:\\ :code:`<port>`\\ :code:`<path>`.
:paramtype path: str
:keyword timeout: The probe timeout in seconds. Probe marked as failed if valid response is not
received with this timeout period. Acceptable values are from 1 second to 86400 seconds.
Expand Down Expand Up @@ -4301,7 +4301,7 @@ class ApplicationGatewayProbe(SubResource):
:ivar host: Host name to send the probe to.
:vartype host: str
:ivar path: Relative path of probe. Valid path starts from '/'. Probe is sent to
:code:`<Protocol>`://:code:`<host>`::code:`<port>`:code:`<path>`.
:code:`<Protocol>`://\\ :code:`<host>`:\\ :code:`<port>`\\ :code:`<path>`.
:vartype path: str
:ivar interval: The probing interval in seconds. This is the time interval between two
consecutive probes. Acceptable values are from 1 second to 86400 seconds.
Expand Down Expand Up @@ -4391,7 +4391,7 @@ def __init__(
:keyword host: Host name to send the probe to.
:paramtype host: str
:keyword path: Relative path of probe. Valid path starts from '/'. Probe is sent to
:code:`<Protocol>`://:code:`<host>`::code:`<port>`:code:`<path>`.
:code:`<Protocol>`://\\ :code:`<host>`:\\ :code:`<port>`\\ :code:`<path>`.
:paramtype path: str
:keyword interval: The probing interval in seconds. This is the time interval between two
consecutive probes. Acceptable values are from 1 second to 86400 seconds.
Expand Down Expand Up @@ -24702,7 +24702,7 @@ class NetworkInterfaceIPConfiguration(SubResource):
:ivar load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules.
:vartype load_balancer_inbound_nat_rules: list[~azure.mgmt.network.models.InboundNatRule]
:ivar private_ip_address: Private IP address of the IP configuration. It can be a single IP
address or a CIDR block in the format :code:`<address>`/:code:`<prefix-length>`.
address or a CIDR block in the format :code:`<address>`/\\ :code:`<prefix-length>`.
:vartype private_ip_address: str
:ivar private_ip_address_prefix_length: The private IP address prefix length. If specified and
the allocation method is dynamic, the service will allocate a CIDR block instead of a single IP
Expand Down Expand Up @@ -24822,7 +24822,7 @@ def __init__(
:keyword load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules.
:paramtype load_balancer_inbound_nat_rules: list[~azure.mgmt.network.models.InboundNatRule]
:keyword private_ip_address: Private IP address of the IP configuration. It can be a single IP
address or a CIDR block in the format :code:`<address>`/:code:`<prefix-length>`.
address or a CIDR block in the format :code:`<address>`/\\ :code:`<prefix-length>`.
:paramtype private_ip_address: str
:keyword private_ip_address_prefix_length: The private IP address prefix length. If specified
and the allocation method is dynamic, the service will allocate a CIDR block instead of a
Expand Down

0 comments on commit a93ae58

Please sign in to comment.