Skip to content

Commit 5b61bd4

Browse files
azure-sdkmsyyc
andauthored
[AutoRelease] t2-cdn-2024-06-12-45722(can only be merged by SDK owner) (#36050)
* code and test * Update CHANGELOG.md * Update _version.py --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]>
1 parent bfd541b commit 5b61bd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+504
-274
lines changed

sdk/cdn/azure-mgmt-cdn/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 13.1.1 (2024-06-12)
4+
5+
### Bugs Fixed
6+
7+
- Fix serialization error when setting model property with `azure.core.serialization.NULL`
8+
39
## 13.1.0 (2024-04-15)
410

511
### Features Added

sdk/cdn/azure-mgmt-cdn/_meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "926540515b9d8059904f023d38c45dda8ba87c9f",
2+
"commit": "de1f3772629b6f4d3ac01548a5f6d719bfb97c9e",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/[email protected].7",
6+
"@autorest/[email protected].19",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/cdn/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/[email protected].7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/cdn/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/[email protected].19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/cdn/resource-manager/readme.md"
1111
}

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ def _deserialize(self, target_obj, data):
14411441
elif isinstance(response, type) and issubclass(response, Enum):
14421442
return self.deserialize_enum(data, response)
14431443

1444-
if data is None:
1444+
if data is None or data is CoreNull:
14451445
return data
14461446
try:
14471447
attributes = response._attribute_map # type: ignore

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "13.1.0"
9+
VERSION = "13.1.1"

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_custom_domains_operations.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
10+
import sys
11+
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1112
import urllib.parse
1213

1314
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -41,6 +42,10 @@
4142
)
4243
from .._vendor import CdnManagementClientMixinABC
4344

45+
if sys.version_info >= (3, 9):
46+
from collections.abc import MutableMapping
47+
else:
48+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4449
T = TypeVar("T")
4550
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
4651

@@ -85,7 +90,7 @@ def list_by_profile(
8590
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8691
cls: ClsType[_models.AFDDomainListResult] = kwargs.pop("cls", None)
8792

88-
error_map = {
93+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8994
401: ClientAuthenticationError,
9095
404: ResourceNotFoundError,
9196
409: ResourceExistsError,
@@ -169,7 +174,7 @@ async def get(
169174
:rtype: ~azure.mgmt.cdn.models.AFDDomain
170175
:raises ~azure.core.exceptions.HttpResponseError:
171176
"""
172-
error_map = {
177+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
173178
401: ClientAuthenticationError,
174179
404: ResourceNotFoundError,
175180
409: ResourceExistsError,
@@ -222,7 +227,7 @@ async def _create_initial(
222227
custom_domain: Union[_models.AFDDomain, IO[bytes]],
223228
**kwargs: Any
224229
) -> _models.AFDDomain:
225-
error_map = {
230+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
226231
401: ClientAuthenticationError,
227232
404: ResourceNotFoundError,
228233
409: ResourceExistsError,
@@ -438,7 +443,7 @@ async def _update_initial(
438443
custom_domain_update_properties: Union[_models.AFDDomainUpdateParameters, IO[bytes]],
439444
**kwargs: Any
440445
) -> _models.AFDDomain:
441-
error_map = {
446+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
442447
401: ClientAuthenticationError,
443448
404: ResourceNotFoundError,
444449
409: ResourceExistsError,
@@ -647,7 +652,7 @@ def get_long_running_output(pipeline_response):
647652
async def _delete_initial( # pylint: disable=inconsistent-return-statements
648653
self, resource_group_name: str, profile_name: str, custom_domain_name: str, **kwargs: Any
649654
) -> None:
650-
error_map = {
655+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
651656
401: ClientAuthenticationError,
652657
404: ResourceNotFoundError,
653658
409: ResourceExistsError,
@@ -757,7 +762,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
757762
async def _refresh_validation_token_initial( # pylint: disable=inconsistent-return-statements
758763
self, resource_group_name: str, profile_name: str, custom_domain_name: str, **kwargs: Any
759764
) -> None:
760-
error_map = {
765+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
761766
401: ClientAuthenticationError,
762767
404: ResourceNotFoundError,
763768
409: ResourceExistsError,

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_endpoints_operations.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
10+
import sys
11+
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1112
import urllib.parse
1213

1314
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -43,6 +44,10 @@
4344
)
4445
from .._vendor import CdnManagementClientMixinABC
4546

47+
if sys.version_info >= (3, 9):
48+
from collections.abc import MutableMapping
49+
else:
50+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4651
T = TypeVar("T")
4752
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
4853

@@ -87,7 +92,7 @@ def list_by_profile(
8792
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8893
cls: ClsType[_models.AFDEndpointListResult] = kwargs.pop("cls", None)
8994

90-
error_map = {
95+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
9196
401: ClientAuthenticationError,
9297
404: ResourceNotFoundError,
9398
409: ResourceExistsError,
@@ -171,7 +176,7 @@ async def get(
171176
:rtype: ~azure.mgmt.cdn.models.AFDEndpoint
172177
:raises ~azure.core.exceptions.HttpResponseError:
173178
"""
174-
error_map = {
179+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
175180
401: ClientAuthenticationError,
176181
404: ResourceNotFoundError,
177182
409: ResourceExistsError,
@@ -224,7 +229,7 @@ async def _create_initial(
224229
endpoint: Union[_models.AFDEndpoint, IO[bytes]],
225230
**kwargs: Any
226231
) -> _models.AFDEndpoint:
227-
error_map = {
232+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
228233
401: ClientAuthenticationError,
229234
404: ResourceNotFoundError,
230235
409: ResourceExistsError,
@@ -443,7 +448,7 @@ async def _update_initial(
443448
endpoint_update_properties: Union[_models.AFDEndpointUpdateParameters, IO[bytes]],
444449
**kwargs: Any
445450
) -> _models.AFDEndpoint:
446-
error_map = {
451+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
447452
401: ClientAuthenticationError,
448453
404: ResourceNotFoundError,
449454
409: ResourceExistsError,
@@ -661,7 +666,7 @@ def get_long_running_output(pipeline_response):
661666
async def _delete_initial( # pylint: disable=inconsistent-return-statements
662667
self, resource_group_name: str, profile_name: str, endpoint_name: str, **kwargs: Any
663668
) -> None:
664-
error_map = {
669+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
665670
401: ClientAuthenticationError,
666671
404: ResourceNotFoundError,
667672
409: ResourceExistsError,
@@ -776,7 +781,7 @@ async def _purge_content_initial( # pylint: disable=inconsistent-return-stateme
776781
contents: Union[_models.AfdPurgeParameters, IO[bytes]],
777782
**kwargs: Any
778783
) -> None:
779-
error_map = {
784+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
780785
401: ClientAuthenticationError,
781786
404: ResourceNotFoundError,
782787
409: ResourceExistsError,
@@ -999,7 +1004,7 @@ def list_resource_usage(
9991004
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
10001005
cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None)
10011006

1002-
error_map = {
1007+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
10031008
401: ClientAuthenticationError,
10041009
404: ResourceNotFoundError,
10051010
409: ResourceExistsError,
@@ -1156,7 +1161,7 @@ async def validate_custom_domain(
11561161
:rtype: ~azure.mgmt.cdn.models.ValidateCustomDomainOutput
11571162
:raises ~azure.core.exceptions.HttpResponseError:
11581163
"""
1159-
error_map = {
1164+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
11601165
401: ClientAuthenticationError,
11611166
404: ResourceNotFoundError,
11621167
409: ResourceExistsError,

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origin_groups_operations.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
10+
import sys
11+
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1112
import urllib.parse
1213

1314
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -41,6 +42,10 @@
4142
)
4243
from .._vendor import CdnManagementClientMixinABC
4344

45+
if sys.version_info >= (3, 9):
46+
from collections.abc import MutableMapping
47+
else:
48+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4449
T = TypeVar("T")
4550
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
4651

@@ -85,7 +90,7 @@ def list_by_profile(
8590
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8691
cls: ClsType[_models.AFDOriginGroupListResult] = kwargs.pop("cls", None)
8792

88-
error_map = {
93+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8994
401: ClientAuthenticationError,
9095
404: ResourceNotFoundError,
9196
409: ResourceExistsError,
@@ -168,7 +173,7 @@ async def get(
168173
:rtype: ~azure.mgmt.cdn.models.AFDOriginGroup
169174
:raises ~azure.core.exceptions.HttpResponseError:
170175
"""
171-
error_map = {
176+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
172177
401: ClientAuthenticationError,
173178
404: ResourceNotFoundError,
174179
409: ResourceExistsError,
@@ -221,7 +226,7 @@ async def _create_initial(
221226
origin_group: Union[_models.AFDOriginGroup, IO[bytes]],
222227
**kwargs: Any
223228
) -> _models.AFDOriginGroup:
224-
error_map = {
229+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
225230
401: ClientAuthenticationError,
226231
404: ResourceNotFoundError,
227232
409: ResourceExistsError,
@@ -437,7 +442,7 @@ async def _update_initial(
437442
origin_group_update_properties: Union[_models.AFDOriginGroupUpdateParameters, IO[bytes]],
438443
**kwargs: Any
439444
) -> _models.AFDOriginGroup:
440-
error_map = {
445+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
441446
401: ClientAuthenticationError,
442447
404: ResourceNotFoundError,
443448
409: ResourceExistsError,
@@ -646,7 +651,7 @@ def get_long_running_output(pipeline_response):
646651
async def _delete_initial( # pylint: disable=inconsistent-return-statements
647652
self, resource_group_name: str, profile_name: str, origin_group_name: str, **kwargs: Any
648653
) -> None:
649-
error_map = {
654+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
650655
401: ClientAuthenticationError,
651656
404: ResourceNotFoundError,
652657
409: ResourceExistsError,
@@ -776,7 +781,7 @@ def list_resource_usage(
776781
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
777782
cls: ClsType[_models.UsagesListResult] = kwargs.pop("cls", None)
778783

779-
error_map = {
784+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
780785
401: ClientAuthenticationError,
781786
404: ResourceNotFoundError,
782787
409: ResourceExistsError,

sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_afd_origins_operations.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
10+
import sys
11+
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1112
import urllib.parse
1213

1314
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,6 +41,10 @@
4041
)
4142
from .._vendor import CdnManagementClientMixinABC
4243

44+
if sys.version_info >= (3, 9):
45+
from collections.abc import MutableMapping
46+
else:
47+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4348
T = TypeVar("T")
4449
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
4550

@@ -87,7 +92,7 @@ def list_by_origin_group(
8792
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8893
cls: ClsType[_models.AFDOriginListResult] = kwargs.pop("cls", None)
8994

90-
error_map = {
95+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
9196
401: ClientAuthenticationError,
9297
404: ResourceNotFoundError,
9398
409: ResourceExistsError,
@@ -173,7 +178,7 @@ async def get(
173178
:rtype: ~azure.mgmt.cdn.models.AFDOrigin
174179
:raises ~azure.core.exceptions.HttpResponseError:
175180
"""
176-
error_map = {
181+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
177182
401: ClientAuthenticationError,
178183
404: ResourceNotFoundError,
179184
409: ResourceExistsError,
@@ -228,7 +233,7 @@ async def _create_initial(
228233
origin: Union[_models.AFDOrigin, IO[bytes]],
229234
**kwargs: Any
230235
) -> _models.AFDOrigin:
231-
error_map = {
236+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
232237
401: ClientAuthenticationError,
233238
404: ResourceNotFoundError,
234239
409: ResourceExistsError,
@@ -455,7 +460,7 @@ async def _update_initial(
455460
origin_update_properties: Union[_models.AFDOriginUpdateParameters, IO[bytes]],
456461
**kwargs: Any
457462
) -> _models.AFDOrigin:
458-
error_map = {
463+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
459464
401: ClientAuthenticationError,
460465
404: ResourceNotFoundError,
461466
409: ResourceExistsError,
@@ -674,7 +679,7 @@ def get_long_running_output(pipeline_response):
674679
async def _delete_initial( # pylint: disable=inconsistent-return-statements
675680
self, resource_group_name: str, profile_name: str, origin_group_name: str, origin_name: str, **kwargs: Any
676681
) -> None:
677-
error_map = {
682+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
678683
401: ClientAuthenticationError,
679684
404: ResourceNotFoundError,
680685
409: ResourceExistsError,

0 commit comments

Comments
 (0)