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
8 changes: 4 additions & 4 deletions sdk/appservice/azure-mgmt-web/_meta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"commit": "ff7b8e12e78b352561e2e470dd045be310a313fa",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"commit": "2bd40179c2fa02f6b6b274f85125dde82657e874",
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.26.4",
"@autorest/python@6.27.4",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/web/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/web/resource-manager/readme.md --generate-sample=True --generate-test=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.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/web/resource-manager/readme.md",
"package-2023-01": "fatal: invalid object name 'from'. from: WebApps.json",
"package-2022-09": "fatal: invalid object name 'from'. from: WebApps.json",
Expand Down
264 changes: 1 addition & 263 deletions sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions sdk/appservice/azure-mgmt-web/azure/mgmt/web/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,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 @@ -562,7 +562,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 @@ -1440,7 +1440,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 @@ -1682,17 +1682,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

Large diffs are not rendered by default.

264 changes: 1 addition & 263 deletions sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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 = "0.0.0"
VERSION = "0.42.0"
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 = "0.0.0"
VERSION = "0.42.0"
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 = "0.0.0"
VERSION = "0.42.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
from typing import (
Any,
AsyncIterable,
AsyncIterator,
Callable,
Dict,
IO,
List,
Optional,
Type,
TypeVar,
Union,
cast,
overload,
)
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
Expand Down Expand Up @@ -287,12 +273,9 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -320,7 +303,7 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -1589,12 +1572,9 @@ async def get_vnet_from_server_farm(
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -1623,7 +1603,7 @@ async def get_vnet_from_server_farm(
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -1938,12 +1918,9 @@ async def get_route_for_vnet(
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -1973,7 +1950,7 @@ async def get_route_for_vnet(
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -2083,16 +2060,9 @@ async def create_or_update_vnet_route(
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
400: cast(
Type[HttpResponseError],
lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat),
),
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -2134,7 +2104,7 @@ async def create_or_update_vnet_route(
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -2167,12 +2137,9 @@ async def delete_vnet_route(
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -2202,7 +2169,7 @@ async def delete_vnet_route(
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -2308,16 +2275,9 @@ async def update_vnet_route(
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
400: cast(
Type[HttpResponseError],
lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat),
),
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -2359,7 +2319,7 @@ async def update_vnet_route(
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
Expand Down Expand Up @@ -243,12 +243,9 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
404: cast(
Type[HttpResponseError],
lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down Expand Up @@ -276,7 +273,7 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
Expand Down Expand Up @@ -1552,10 +1552,6 @@ async def transfer_out(self, resource_group_name: str, domain_name: str, **kwarg
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
400: cast(
Type[HttpResponseError],
lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat),
),
}
error_map.update(kwargs.pop("error_map", {}) or {})

Expand Down
Loading