|
8 | 8 | # -------------------------------------------------------------------------- |
9 | 9 | from io import IOBase |
10 | 10 | import sys |
11 | | -from typing import ( |
12 | | - Any, |
13 | | - AsyncIterable, |
14 | | - AsyncIterator, |
15 | | - Callable, |
16 | | - Dict, |
17 | | - IO, |
18 | | - List, |
19 | | - Optional, |
20 | | - Type, |
21 | | - TypeVar, |
22 | | - Union, |
23 | | - cast, |
24 | | - overload, |
25 | | -) |
| 11 | +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload |
26 | 12 | import urllib.parse |
27 | 13 |
|
28 | 14 | from azure.core.async_paging import AsyncItemPaged, AsyncList |
@@ -287,12 +273,9 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode |
287 | 273 | """ |
288 | 274 | error_map: MutableMapping = { |
289 | 275 | 401: ClientAuthenticationError, |
| 276 | + 404: ResourceNotFoundError, |
290 | 277 | 409: ResourceExistsError, |
291 | 278 | 304: ResourceNotModifiedError, |
292 | | - 404: cast( |
293 | | - Type[HttpResponseError], |
294 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
295 | | - ), |
296 | 279 | } |
297 | 280 | error_map.update(kwargs.pop("error_map", {}) or {}) |
298 | 281 |
|
@@ -320,7 +303,7 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode |
320 | 303 | response = pipeline_response.http_response |
321 | 304 |
|
322 | 305 | if response.status_code not in [200]: |
323 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 306 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
324 | 307 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
325 | 308 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
326 | 309 |
|
@@ -1589,12 +1572,9 @@ async def get_vnet_from_server_farm( |
1589 | 1572 | """ |
1590 | 1573 | error_map: MutableMapping = { |
1591 | 1574 | 401: ClientAuthenticationError, |
| 1575 | + 404: ResourceNotFoundError, |
1592 | 1576 | 409: ResourceExistsError, |
1593 | 1577 | 304: ResourceNotModifiedError, |
1594 | | - 404: cast( |
1595 | | - Type[HttpResponseError], |
1596 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
1597 | | - ), |
1598 | 1578 | } |
1599 | 1579 | error_map.update(kwargs.pop("error_map", {}) or {}) |
1600 | 1580 |
|
@@ -1623,7 +1603,7 @@ async def get_vnet_from_server_farm( |
1623 | 1603 | response = pipeline_response.http_response |
1624 | 1604 |
|
1625 | 1605 | if response.status_code not in [200]: |
1626 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 1606 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
1627 | 1607 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
1628 | 1608 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
1629 | 1609 |
|
@@ -1938,12 +1918,9 @@ async def get_route_for_vnet( |
1938 | 1918 | """ |
1939 | 1919 | error_map: MutableMapping = { |
1940 | 1920 | 401: ClientAuthenticationError, |
| 1921 | + 404: ResourceNotFoundError, |
1941 | 1922 | 409: ResourceExistsError, |
1942 | 1923 | 304: ResourceNotModifiedError, |
1943 | | - 404: cast( |
1944 | | - Type[HttpResponseError], |
1945 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
1946 | | - ), |
1947 | 1924 | } |
1948 | 1925 | error_map.update(kwargs.pop("error_map", {}) or {}) |
1949 | 1926 |
|
@@ -1973,7 +1950,7 @@ async def get_route_for_vnet( |
1973 | 1950 | response = pipeline_response.http_response |
1974 | 1951 |
|
1975 | 1952 | if response.status_code not in [200]: |
1976 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 1953 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
1977 | 1954 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
1978 | 1955 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
1979 | 1956 |
|
@@ -2083,16 +2060,9 @@ async def create_or_update_vnet_route( |
2083 | 2060 | """ |
2084 | 2061 | error_map: MutableMapping = { |
2085 | 2062 | 401: ClientAuthenticationError, |
| 2063 | + 404: ResourceNotFoundError, |
2086 | 2064 | 409: ResourceExistsError, |
2087 | 2065 | 304: ResourceNotModifiedError, |
2088 | | - 400: cast( |
2089 | | - Type[HttpResponseError], |
2090 | | - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), |
2091 | | - ), |
2092 | | - 404: cast( |
2093 | | - Type[HttpResponseError], |
2094 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
2095 | | - ), |
2096 | 2066 | } |
2097 | 2067 | error_map.update(kwargs.pop("error_map", {}) or {}) |
2098 | 2068 |
|
@@ -2134,7 +2104,7 @@ async def create_or_update_vnet_route( |
2134 | 2104 | response = pipeline_response.http_response |
2135 | 2105 |
|
2136 | 2106 | if response.status_code not in [200]: |
2137 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 2107 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
2138 | 2108 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
2139 | 2109 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
2140 | 2110 |
|
@@ -2167,12 +2137,9 @@ async def delete_vnet_route( |
2167 | 2137 | """ |
2168 | 2138 | error_map: MutableMapping = { |
2169 | 2139 | 401: ClientAuthenticationError, |
| 2140 | + 404: ResourceNotFoundError, |
2170 | 2141 | 409: ResourceExistsError, |
2171 | 2142 | 304: ResourceNotModifiedError, |
2172 | | - 404: cast( |
2173 | | - Type[HttpResponseError], |
2174 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
2175 | | - ), |
2176 | 2143 | } |
2177 | 2144 | error_map.update(kwargs.pop("error_map", {}) or {}) |
2178 | 2145 |
|
@@ -2202,7 +2169,7 @@ async def delete_vnet_route( |
2202 | 2169 | response = pipeline_response.http_response |
2203 | 2170 |
|
2204 | 2171 | if response.status_code not in [200]: |
2205 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 2172 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
2206 | 2173 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
2207 | 2174 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
2208 | 2175 |
|
@@ -2308,16 +2275,9 @@ async def update_vnet_route( |
2308 | 2275 | """ |
2309 | 2276 | error_map: MutableMapping = { |
2310 | 2277 | 401: ClientAuthenticationError, |
| 2278 | + 404: ResourceNotFoundError, |
2311 | 2279 | 409: ResourceExistsError, |
2312 | 2280 | 304: ResourceNotModifiedError, |
2313 | | - 400: cast( |
2314 | | - Type[HttpResponseError], |
2315 | | - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), |
2316 | | - ), |
2317 | | - 404: cast( |
2318 | | - Type[HttpResponseError], |
2319 | | - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), |
2320 | | - ), |
2321 | 2281 | } |
2322 | 2282 | error_map.update(kwargs.pop("error_map", {}) or {}) |
2323 | 2283 |
|
@@ -2359,7 +2319,7 @@ async def update_vnet_route( |
2359 | 2319 | response = pipeline_response.http_response |
2360 | 2320 |
|
2361 | 2321 | if response.status_code not in [200]: |
2362 | | - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore |
| 2322 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
2363 | 2323 | error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) |
2364 | 2324 | raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) |
2365 | 2325 |
|
|
0 commit comments