Skip to content

Commit 675cb39

Browse files
azure-sdkmsyycChenxiJiang333
authored
[AutoRelease] t2-netapp-2024-07-01-16088(can only be merged by SDK owner) (#36300)
* code and test * Update assets.json * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent b18b26d commit 675cb39

Some content is hidden

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

43 files changed

+413
-228
lines changed

sdk/netapp/azure-mgmt-netapp/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.0 (2024-07-22)
4+
5+
### Features Added
6+
7+
- Model VolumePatch has a new parameter protocol_types
8+
39
## 13.0.0 (2024-05-20)
410

511
### Features Added
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "2dc0129e1e3f5dfb6c86195aae57fc19e7c72e01",
2+
"commit": "81a4ee5a83ae38620c0e1404793caffe005d26e4",
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/netapp/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/netapp/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 --tag=package-netapp-2023-11-01 --use=@autorest/[email protected].19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/netapp/resource-manager/readme.md"
1111
}

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_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.0.0"
9+
VERSION = "13.1.0"

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/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/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py

Lines changed: 13 additions & 8 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
build_update_request,
4243
)
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

@@ -80,7 +85,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetAppAc
8085
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8186
cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None)
8287

83-
error_map = {
88+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8489
401: ClientAuthenticationError,
8590
404: ResourceNotFoundError,
8691
409: ResourceExistsError,
@@ -162,7 +167,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model
162167
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
163168
cls: ClsType[_models.NetAppAccountList] = kwargs.pop("cls", None)
164169

165-
error_map = {
170+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
166171
401: ClientAuthenticationError,
167172
404: ResourceNotFoundError,
168173
409: ResourceExistsError,
@@ -241,7 +246,7 @@ async def get(self, resource_group_name: str, account_name: str, **kwargs: Any)
241246
:rtype: ~azure.mgmt.netapp.models.NetAppAccount
242247
:raises ~azure.core.exceptions.HttpResponseError:
243248
"""
244-
error_map = {
249+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
245250
401: ClientAuthenticationError,
246251
404: ResourceNotFoundError,
247252
409: ResourceExistsError,
@@ -288,7 +293,7 @@ async def get(self, resource_group_name: str, account_name: str, **kwargs: Any)
288293
async def _create_or_update_initial(
289294
self, resource_group_name: str, account_name: str, body: Union[_models.NetAppAccount, IO[bytes]], **kwargs: Any
290295
) -> _models.NetAppAccount:
291-
error_map = {
296+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
292297
401: ClientAuthenticationError,
293298
404: ResourceNotFoundError,
294299
409: ResourceExistsError,
@@ -481,7 +486,7 @@ def get_long_running_output(pipeline_response):
481486
async def _delete_initial( # pylint: disable=inconsistent-return-statements
482487
self, resource_group_name: str, account_name: str, **kwargs: Any
483488
) -> None:
484-
error_map = {
489+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
485490
401: ClientAuthenticationError,
486491
404: ResourceNotFoundError,
487492
409: ResourceExistsError,
@@ -584,7 +589,7 @@ async def _update_initial(
584589
body: Union[_models.NetAppAccountPatch, IO[bytes]],
585590
**kwargs: Any
586591
) -> _models.NetAppAccount:
587-
error_map = {
592+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
588593
401: ClientAuthenticationError,
589594
404: ResourceNotFoundError,
590595
409: ResourceExistsError,
@@ -780,7 +785,7 @@ def get_long_running_output(pipeline_response):
780785
async def _renew_credentials_initial( # pylint: disable=inconsistent-return-statements
781786
self, resource_group_name: str, account_name: str, **kwargs: Any
782787
) -> None:
783-
error_map = {
788+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
784789
401: ClientAuthenticationError,
785790
404: ResourceNotFoundError,
786791
409: ResourceExistsError,

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_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
@@ -39,6 +40,10 @@
3940
build_update_request,
4041
)
4142

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

@@ -83,7 +88,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> As
8388
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8489
cls: ClsType[_models.BackupPoliciesList] = kwargs.pop("cls", None)
8590

86-
error_map = {
91+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8792
401: ClientAuthenticationError,
8893
404: ResourceNotFoundError,
8994
409: ResourceExistsError,
@@ -167,7 +172,7 @@ async def get(
167172
:rtype: ~azure.mgmt.netapp.models.BackupPolicy
168173
:raises ~azure.core.exceptions.HttpResponseError:
169174
"""
170-
error_map = {
175+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
171176
401: ClientAuthenticationError,
172177
404: ResourceNotFoundError,
173178
409: ResourceExistsError,
@@ -220,7 +225,7 @@ async def _create_initial(
220225
body: Union[_models.BackupPolicy, IO[bytes]],
221226
**kwargs: Any
222227
) -> Optional[_models.BackupPolicy]:
223-
error_map = {
228+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
224229
401: ClientAuthenticationError,
225230
404: ResourceNotFoundError,
226231
409: ResourceExistsError,
@@ -434,7 +439,7 @@ async def _update_initial(
434439
body: Union[_models.BackupPolicyPatch, IO[bytes]],
435440
**kwargs: Any
436441
) -> _models.BackupPolicy:
437-
error_map = {
442+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
438443
401: ClientAuthenticationError,
439444
404: ResourceNotFoundError,
440445
409: ResourceExistsError,
@@ -642,7 +647,7 @@ def get_long_running_output(pipeline_response):
642647
async def _delete_initial( # pylint: disable=inconsistent-return-statements
643648
self, resource_group_name: str, account_name: str, backup_policy_name: str, **kwargs: Any
644649
) -> None:
645-
error_map = {
650+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
646651
401: ClientAuthenticationError,
647652
404: ResourceNotFoundError,
648653
409: ResourceExistsError,

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_vaults_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
@@ -39,6 +40,10 @@
3940
build_update_request,
4041
)
4142

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

@@ -85,7 +90,7 @@ def list_by_net_app_account(
8590
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8691
cls: ClsType[_models.BackupVaultsList] = 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.netapp.models.BackupVault
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_or_update_initial(
222227
body: Union[_models.BackupVault, IO[bytes]],
223228
**kwargs: Any
224229
) -> _models.BackupVault:
225-
error_map = {
230+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
226231
401: ClientAuthenticationError,
227232
404: ResourceNotFoundError,
228233
409: ResourceExistsError,
@@ -435,7 +440,7 @@ async def _update_initial(
435440
body: Union[_models.BackupVaultPatch, IO[bytes]],
436441
**kwargs: Any
437442
) -> _models.BackupVault:
438-
error_map = {
443+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
439444
401: ClientAuthenticationError,
440445
404: ResourceNotFoundError,
441446
409: ResourceExistsError,
@@ -645,7 +650,7 @@ def get_long_running_output(pipeline_response):
645650
async def _delete_initial( # pylint: disable=inconsistent-return-statements
646651
self, resource_group_name: str, account_name: str, backup_vault_name: str, **kwargs: Any
647652
) -> None:
648-
error_map = {
653+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
649654
401: ClientAuthenticationError,
650655
404: ResourceNotFoundError,
651656
409: ResourceExistsError,

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py

Lines changed: 13 additions & 8 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
build_update_request,
4243
)
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 @@ async def get_latest_status(
8590
:rtype: ~azure.mgmt.netapp.models.BackupStatus
8691
:raises ~azure.core.exceptions.HttpResponseError:
8792
"""
88-
error_map = {
93+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8994
401: ClientAuthenticationError,
9095
404: ResourceNotFoundError,
9196
409: ResourceExistsError,
@@ -152,7 +157,7 @@ async def get_volume_latest_restore_status(
152157
:rtype: ~azure.mgmt.netapp.models.RestoreStatus
153158
:raises ~azure.core.exceptions.HttpResponseError:
154159
"""
155-
error_map = {
160+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
156161
401: ClientAuthenticationError,
157162
404: ResourceNotFoundError,
158163
409: ResourceExistsError,
@@ -231,7 +236,7 @@ def list_by_vault(
231236
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
232237
cls: ClsType[_models.BackupsList] = kwargs.pop("cls", None)
233238

234-
error_map = {
239+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
235240
401: ClientAuthenticationError,
236241
404: ResourceNotFoundError,
237242
409: ResourceExistsError,
@@ -319,7 +324,7 @@ async def get(
319324
:rtype: ~azure.mgmt.netapp.models.Backup
320325
:raises ~azure.core.exceptions.HttpResponseError:
321326
"""
322-
error_map = {
327+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
323328
401: ClientAuthenticationError,
324329
404: ResourceNotFoundError,
325330
409: ResourceExistsError,
@@ -374,7 +379,7 @@ async def _create_initial(
374379
body: Union[_models.Backup, IO[bytes]],
375380
**kwargs: Any
376381
) -> _models.Backup:
377-
error_map = {
382+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
378383
401: ClientAuthenticationError,
379384
404: ResourceNotFoundError,
380385
409: ResourceExistsError,
@@ -599,7 +604,7 @@ async def _update_initial(
599604
body: Optional[Union[_models.BackupPatch, IO[bytes]]] = None,
600605
**kwargs: Any
601606
) -> _models.Backup:
602-
error_map = {
607+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
603608
401: ClientAuthenticationError,
604609
404: ResourceNotFoundError,
605610
409: ResourceExistsError,
@@ -823,7 +828,7 @@ def get_long_running_output(pipeline_response):
823828
async def _delete_initial( # pylint: disable=inconsistent-return-statements
824829
self, resource_group_name: str, account_name: str, backup_vault_name: str, backup_name: str, **kwargs: Any
825830
) -> None:
826-
error_map = {
831+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
827832
401: ClientAuthenticationError,
828833
404: ResourceNotFoundError,
829834
409: ResourceExistsError,

0 commit comments

Comments
 (0)