diff --git a/sdk/netapp/azure-mgmt-netapp/_meta.json b/sdk/netapp/azure-mgmt-netapp/_meta.json
index 59cc7018d0fc0..2cb02b38822c8 100644
--- a/sdk/netapp/azure-mgmt-netapp/_meta.json
+++ b/sdk/netapp/azure-mgmt-netapp/_meta.json
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"use": [
- "@autorest/python@5.13.0",
+ "@autorest/python@5.16.0",
"@autorest/modelerfour@4.19.3"
],
- "commit": "9a6b5748f6ba9eeb2684497551226036c9d1da6b",
+ "commit": "8612e523f7d3d69945aec32f543f415d0adeb301",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
- "autorest_command": "autorest specification/netapp/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
+ "autorest_command": "autorest specification/netapp/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/netapp/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py
index b9f5b3f192329..e33fd988f395f 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/__init__.py
@@ -10,9 +10,14 @@
from ._version import VERSION
__version__ = VERSION
+
+try:
+ from ._patch import __all__ as _patch_all
+ from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
+except ImportError:
+ _patch_all = []
+from ._patch import patch_sdk as _patch_sdk
__all__ = ['NetAppManagementClient']
+__all__.extend([p for p in _patch_all if p not in __all__])
-# `._patch.py` is used for handwritten extensions to the generated code
-# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
-from ._patch import patch_sdk
-patch_sdk()
+_patch_sdk()
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py
index ec9713173f34b..cd65ef9e18d2b 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py
@@ -30,7 +30,7 @@ class NetAppManagementClientConfiguration(Configuration): # pylint: disable=too
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2022-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
@@ -42,7 +42,7 @@ def __init__(
**kwargs: Any
) -> None:
super(NetAppManagementClientConfiguration, self).__init__(**kwargs)
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', "2022-03-01") # type: str
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py
index f91a1fdaf8c9d..789b7b26532b5 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py
@@ -63,7 +63,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2022-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -84,21 +84,51 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
- self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
- self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.accounts = AccountsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.pools = PoolsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volumes = VolumesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.snapshot_policies = SnapshotPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.backups = BackupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.account_backups = AccountBackupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volume_quota_rules = VolumeQuotaRulesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.operations = Operations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.net_app_resource = NetAppResourceOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.accounts = AccountsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.pools = PoolsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volumes = VolumesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.snapshots = SnapshotsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.snapshot_policies = SnapshotPoliciesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.backups = BackupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.account_backups = AccountBackupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.backup_policies = BackupPoliciesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volume_quota_rules = VolumeQuotaRulesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.vaults = VaultsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volume_groups = VolumeGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.subvolumes = SubvolumesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
def _send_request(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
index 142a0420b39b4..e786ca9d25659 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "8.0.0"
+VERSION = "5.1.0"
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/__init__.py
index c1ce68ce405cb..48fe5810bb5ab 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/__init__.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/__init__.py
@@ -7,9 +7,14 @@
# --------------------------------------------------------------------------
from ._net_app_management_client import NetAppManagementClient
+
+try:
+ from ._patch import __all__ as _patch_all
+ from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
+except ImportError:
+ _patch_all = []
+from ._patch import patch_sdk as _patch_sdk
__all__ = ['NetAppManagementClient']
+__all__.extend([p for p in _patch_all if p not in __all__])
-# `._patch.py` is used for handwritten extensions to the generated code
-# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
-from ._patch import patch_sdk
-patch_sdk()
+_patch_sdk()
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py
index 9636b410a50fd..fe48a4509f26d 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py
@@ -30,7 +30,7 @@ class NetAppManagementClientConfiguration(Configuration): # pylint: disable=too
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2022-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
@@ -42,7 +42,7 @@ def __init__(
**kwargs: Any
) -> None:
super(NetAppManagementClientConfiguration, self).__init__(**kwargs)
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', "2022-03-01") # type: str
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py
index 01d9a3079116e..db743e030ede0 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py
@@ -63,7 +63,7 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2022-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -84,21 +84,51 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
- self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
- self.net_app_resource = NetAppResourceOperations(self._client, self._config, self._serialize, self._deserialize)
- self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.accounts = AccountsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.pools = PoolsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volumes = VolumesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.snapshot_policies = SnapshotPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.backups = BackupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.account_backups = AccountBackupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volume_quota_rules = VolumeQuotaRulesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.volume_groups = VolumeGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
- self.subvolumes = SubvolumesOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.operations = Operations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.net_app_resource = NetAppResourceOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.accounts = AccountsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.pools = PoolsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volumes = VolumesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.snapshots = SnapshotsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.snapshot_policies = SnapshotPoliciesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.backups = BackupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.account_backups = AccountBackupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.backup_policies = BackupPoliciesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volume_quota_rules = VolumeQuotaRulesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.vaults = VaultsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.volume_groups = VolumeGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.subvolumes = SubvolumesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
def _send_request(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py
index 7b804194eeb54..86c8adf317b2f 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/__init__.py
@@ -22,6 +22,9 @@
from ._volume_groups_operations import VolumeGroupsOperations
from ._subvolumes_operations import SubvolumesOperations
+from ._patch import __all__ as _patch_all
+from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
+from ._patch import patch_sdk as _patch_sdk
__all__ = [
'Operations',
'NetAppResourceOperations',
@@ -39,3 +42,5 @@
'VolumeGroupsOperations',
'SubvolumesOperations',
]
+__all__.extend([p for p in _patch_all if p not in __all__])
+_patch_sdk()
\ No newline at end of file
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py
index 9fd4a19b645e5..9fc67ba2046c0 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class AccountBackupsOperations:
- """AccountBackupsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`account_backups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -53,7 +52,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.BackupsList"]:
+ ) -> AsyncIterable[_models.BackupsList]:
"""List Backups for a Netapp Account.
List all Backups for a Netapp Account.
@@ -67,13 +66,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.BackupsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -83,9 +85,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -95,9 +99,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -137,7 +143,7 @@ async def get(
account_name: str,
backup_name: str,
**kwargs: Any
- ) -> "_models.Backup":
+ ) -> _models.Backup:
"""Get Backup for a Netapp Account.
Gets the specified backup for a Netapp Account.
@@ -153,13 +159,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.Backup
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
request = build_get_request(
@@ -169,11 +178,13 @@ async def get(
backup_name=backup_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -201,13 +212,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -217,11 +231,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -268,21 +284,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_name=backup_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -292,8 +313,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py
index 826d7b803bcb9..ec208893f4d7f 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,32 +27,30 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class AccountsOperations:
- """AccountsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`accounts` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_subscription(
self,
**kwargs: Any
- ) -> AsyncIterable["_models.NetAppAccountList"]:
+ ) -> AsyncIterable[_models.NetAppAccountList]:
"""Describe all NetApp Accounts in a subscription.
List and describe all NetApp accounts in the subscription.
@@ -61,13 +60,16 @@ def list_by_subscription(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.NetAppAccountList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccountList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccountList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -75,9 +77,11 @@ def prepare_request(next_link=None):
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_subscription.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -85,9 +89,11 @@ def prepare_request(next_link=None):
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -125,7 +131,7 @@ def list(
self,
resource_group_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.NetAppAccountList"]:
+ ) -> AsyncIterable[_models.NetAppAccountList]:
"""Describe all NetApp Accounts in a resource group.
List and describe all NetApp accounts in the resource group.
@@ -137,13 +143,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.NetAppAccountList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccountList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccountList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -152,9 +161,11 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -163,9 +174,11 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -204,7 +217,7 @@ async def get(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> "_models.NetAppAccount":
+ ) -> _models.NetAppAccount:
"""Describe a NetApp Account.
Get the NetApp account.
@@ -218,13 +231,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.NetAppAccount
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
request = build_get_request(
@@ -233,11 +249,13 @@ async def get(
account_name=account_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -262,17 +280,20 @@ async def _create_or_update_initial(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccount",
+ body: _models.NetAppAccount,
**kwargs: Any
- ) -> "_models.NetAppAccount":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
+ ) -> _models.NetAppAccount:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
_json = self._serialize.body(body, 'NetAppAccount')
@@ -284,11 +305,13 @@ async def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -318,9 +341,9 @@ async def begin_create_or_update(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccount",
+ body: _models.NetAppAccount,
**kwargs: Any
- ) -> AsyncLROPoller["_models.NetAppAccount"]:
+ ) -> AsyncLROPoller[_models.NetAppAccount]:
"""Create or update a NetApp account.
Create or update the specified NetApp account within the resource group.
@@ -344,37 +367,47 @@ async def begin_create_or_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.NetAppAccount]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_or_update_initial(
+ raw_result = await self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
body=body,
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('NetAppAccount', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -393,13 +426,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
account_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -408,11 +444,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
account_name=account_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -456,20 +494,25 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -479,8 +522,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -497,17 +546,20 @@ async def _update_initial(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccountPatch",
+ body: _models.NetAppAccountPatch,
**kwargs: Any
- ) -> "_models.NetAppAccount":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
+ ) -> _models.NetAppAccount:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
_json = self._serialize.body(body, 'NetAppAccountPatch')
@@ -519,11 +571,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -553,9 +607,9 @@ async def begin_update(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccountPatch",
+ body: _models.NetAppAccountPatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.NetAppAccount"]:
+ ) -> AsyncLROPoller[_models.NetAppAccount]:
"""Update a NetApp account.
Patch the specified NetApp account.
@@ -579,37 +633,47 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.NetAppAccount]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
body=body,
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('NetAppAccount', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py
index 385759ce66887..6aeb7ff6e7389 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class BackupPoliciesOperations:
- """BackupPoliciesOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`backup_policies` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -53,7 +52,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.BackupPoliciesList"]:
+ ) -> AsyncIterable[_models.BackupPoliciesList]:
"""List backup policies.
List backup policies for Netapp Account.
@@ -67,13 +66,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.BackupPoliciesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPoliciesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPoliciesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -83,9 +85,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -95,9 +99,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -137,7 +143,7 @@ async def get(
account_name: str,
backup_policy_name: str,
**kwargs: Any
- ) -> "_models.BackupPolicy":
+ ) -> _models.BackupPolicy:
"""Get a backup Policy.
Get a particular backup Policy.
@@ -153,13 +159,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.BackupPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
request = build_get_request(
@@ -169,11 +178,13 @@ async def get(
backup_policy_name=backup_policy_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -199,17 +210,20 @@ async def _create_initial(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicy",
+ body: _models.BackupPolicy,
**kwargs: Any
- ) -> Optional["_models.BackupPolicy"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BackupPolicy"]]
+ ) -> Optional[_models.BackupPolicy]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.BackupPolicy]]
_json = self._serialize.body(body, 'BackupPolicy')
@@ -222,11 +236,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -258,9 +274,9 @@ async def begin_create(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicy",
+ body: _models.BackupPolicy,
**kwargs: Any
- ) -> AsyncLROPoller["_models.BackupPolicy"]:
+ ) -> AsyncLROPoller[_models.BackupPolicy]:
"""Create a backup policy.
Create a backup policy for Netapp Account.
@@ -286,17 +302,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.BackupPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
@@ -304,20 +323,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('BackupPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -335,17 +361,20 @@ async def _update_initial(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicyPatch",
+ body: _models.BackupPolicyPatch,
**kwargs: Any
- ) -> "_models.BackupPolicy":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
+ ) -> _models.BackupPolicy:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
_json = self._serialize.body(body, 'BackupPolicyPatch')
@@ -358,11 +387,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -393,9 +424,9 @@ async def begin_update(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicyPatch",
+ body: _models.BackupPolicyPatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.BackupPolicy"]:
+ ) -> AsyncLROPoller[_models.BackupPolicy]:
"""Patch a backup policy.
Patch a backup policy for Netapp Account.
@@ -421,17 +452,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.BackupPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
@@ -439,20 +473,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('BackupPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -472,13 +513,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_policy_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -488,11 +532,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_policy_name=backup_policy_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -539,21 +585,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -563,8 +614,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py
index 5204b6bee8ebe..5fec8cc934d97 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class BackupsOperations:
- """BackupsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`backups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace_async
async def get_status(
@@ -55,7 +54,7 @@ async def get_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.BackupStatus":
+ ) -> _models.BackupStatus:
"""Get volume's backup status.
Get the status of the backup for a volume.
@@ -73,13 +72,16 @@ async def get_status(
:rtype: ~azure.mgmt.netapp.models.BackupStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupStatus]
request = build_get_status_request(
@@ -90,11 +92,13 @@ async def get_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.get_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -123,7 +127,7 @@ async def get_volume_restore_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.RestoreStatus":
+ ) -> _models.RestoreStatus:
"""Get volume's restore status.
Get the status of the restore for a volume.
@@ -141,13 +145,16 @@ async def get_volume_restore_status(
:rtype: ~azure.mgmt.netapp.models.RestoreStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.RestoreStatus]
request = build_get_volume_restore_status_request(
@@ -158,11 +165,13 @@ async def get_volume_restore_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.get_volume_restore_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -191,7 +200,7 @@ def list(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.BackupsList"]:
+ ) -> AsyncIterable[_models.BackupsList]:
"""List Backups.
List all backups for a volume.
@@ -209,13 +218,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.BackupsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -227,9 +239,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -241,9 +255,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -285,7 +301,7 @@ async def get(
volume_name: str,
backup_name: str,
**kwargs: Any
- ) -> "_models.Backup":
+ ) -> _models.Backup:
"""Get a backup.
Gets the specified backup of the volume.
@@ -305,13 +321,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.Backup
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
request = build_get_request(
@@ -323,11 +342,13 @@ async def get(
backup_name=backup_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -355,17 +376,20 @@ async def _create_initial(
pool_name: str,
volume_name: str,
backup_name: str,
- body: "_models.Backup",
+ body: _models.Backup,
**kwargs: Any
- ) -> Optional["_models.Backup"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Backup"]]
+ ) -> Optional[_models.Backup]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Backup]]
_json = self._serialize.body(body, 'Backup')
@@ -380,11 +404,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -418,9 +444,9 @@ async def begin_create(
pool_name: str,
volume_name: str,
backup_name: str,
- body: "_models.Backup",
+ body: _models.Backup,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Backup"]:
+ ) -> AsyncLROPoller[_models.Backup]:
"""Create a backup.
Create a backup for the volume.
@@ -450,17 +476,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -470,20 +499,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Backup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -503,17 +539,20 @@ async def _update_initial(
pool_name: str,
volume_name: str,
backup_name: str,
- body: Optional["_models.BackupPatch"] = None,
+ body: Optional[_models.BackupPatch] = None,
**kwargs: Any
- ) -> "_models.Backup":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
+ ) -> _models.Backup:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
if body is not None:
_json = self._serialize.body(body, 'BackupPatch')
@@ -531,11 +570,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -568,9 +609,9 @@ async def begin_update(
pool_name: str,
volume_name: str,
backup_name: str,
- body: Optional["_models.BackupPatch"] = None,
+ body: Optional[_models.BackupPatch] = None,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Backup"]:
+ ) -> AsyncLROPoller[_models.Backup]:
"""Patch a backup.
Patch a backup for the volume.
@@ -600,17 +641,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Backup]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -620,20 +664,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Backup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -655,13 +706,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -673,11 +727,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -730,16 +786,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -747,6 +806,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -756,8 +817,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py
index 46db59160dcd2..4cd1b8b3de1d5 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py
@@ -13,6 +13,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
@@ -22,26 +23,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class NetAppResourceOperations:
- """NetAppResourceOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`net_app_resource` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace_async
async def check_name_availability(
@@ -51,7 +50,7 @@ async def check_name_availability(
type: Union[str, "_models.CheckNameResourceTypes"],
resource_group: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check resource name availability.
Check if a resource name is available.
@@ -69,14 +68,17 @@ async def check_name_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group)
_json = self._serialize.body(_body, 'ResourceNameAvailabilityRequest')
@@ -88,11 +90,13 @@ async def check_name_availability(
content_type=content_type,
json=_json,
template_url=self.check_name_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -120,7 +124,7 @@ async def check_file_path_availability(
name: str,
subnet_id: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check file path availability.
Check if a file path is available.
@@ -137,14 +141,17 @@ async def check_file_path_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.FilePathAvailabilityRequest(name=name, subnet_id=subnet_id)
_json = self._serialize.body(_body, 'FilePathAvailabilityRequest')
@@ -156,11 +163,13 @@ async def check_file_path_availability(
content_type=content_type,
json=_json,
template_url=self.check_file_path_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -189,7 +198,7 @@ async def check_quota_availability(
type: Union[str, "_models.CheckQuotaNameResourceTypes"],
resource_group: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check quota availability.
Check if a quota is available.
@@ -207,14 +216,17 @@ async def check_quota_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.QuotaAvailabilityRequest(name=name, type=type, resource_group=resource_group)
_json = self._serialize.body(_body, 'QuotaAvailabilityRequest')
@@ -226,11 +238,13 @@ async def check_quota_availability(
content_type=content_type,
json=_json,
template_url=self.check_quota_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py
index a7b2efaaaaab3..632f5ec0a17c1 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_quota_limits_operations.py
@@ -15,6 +15,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
@@ -24,33 +25,31 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class NetAppResourceQuotaLimitsOperations:
- """NetAppResourceQuotaLimitsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`net_app_resource_quota_limits` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
self,
location: str,
**kwargs: Any
- ) -> AsyncIterable["_models.SubscriptionQuotaItemList"]:
+ ) -> AsyncIterable[_models.SubscriptionQuotaItemList]:
"""Get quota limits.
Get the default and current limits for quotas.
@@ -64,13 +63,16 @@ def list(
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.SubscriptionQuotaItemList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubscriptionQuotaItemList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionQuotaItemList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -79,9 +81,11 @@ def prepare_request(next_link=None):
location=location,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -90,9 +94,11 @@ def prepare_request(next_link=None):
location=location,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -131,7 +137,7 @@ async def get(
location: str,
quota_limit_name: str,
**kwargs: Any
- ) -> "_models.SubscriptionQuotaItem":
+ ) -> _models.SubscriptionQuotaItem:
"""Get quota limits.
Get the default and current subscription quota limit.
@@ -145,13 +151,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.SubscriptionQuotaItem
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionQuotaItem"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubscriptionQuotaItem]
request = build_get_request(
@@ -160,11 +169,13 @@ async def get(
quota_limit_name=quota_limit_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py
index 86a2e738b2e92..5aa257ad647dc 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py
@@ -14,6 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
@@ -23,32 +24,30 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class Operations:
- """Operations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`operations` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
self,
**kwargs: Any
- ) -> AsyncIterable["_models.OperationListResult"]:
+ ) -> AsyncIterable[_models.OperationListResult]:
"""Describes the Resource Provider.
Lists all of the available Microsoft.NetApp Rest API operations.
@@ -58,31 +57,38 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_patch.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_patch.py
new file mode 100644
index 0000000000000..0ad201a8c586e
--- /dev/null
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_patch.py
@@ -0,0 +1,19 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py
index 69571cbb53269..e9064d0930115 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_pools_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class PoolsOperations:
- """PoolsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`pools` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -53,7 +52,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.CapacityPoolList"]:
+ ) -> AsyncIterable[_models.CapacityPoolList]:
"""Describe all Capacity Pools.
List all capacity pools in the NetApp Account.
@@ -67,13 +66,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.CapacityPoolList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPoolList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPoolList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -83,9 +85,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -95,9 +99,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -137,7 +143,7 @@ async def get(
account_name: str,
pool_name: str,
**kwargs: Any
- ) -> "_models.CapacityPool":
+ ) -> _models.CapacityPool:
"""Describe a Capacity Pool.
Get details of the specified capacity pool.
@@ -153,13 +159,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.CapacityPool
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
request = build_get_request(
@@ -169,11 +178,13 @@ async def get(
pool_name=pool_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -199,17 +210,20 @@ async def _create_or_update_initial(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPool",
+ body: _models.CapacityPool,
**kwargs: Any
- ) -> "_models.CapacityPool":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
+ ) -> _models.CapacityPool:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
_json = self._serialize.body(body, 'CapacityPool')
@@ -222,11 +236,13 @@ async def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -257,9 +273,9 @@ async def begin_create_or_update(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPool",
+ body: _models.CapacityPool,
**kwargs: Any
- ) -> AsyncLROPoller["_models.CapacityPool"]:
+ ) -> AsyncLROPoller[_models.CapacityPool]:
"""Create or Update the specified capacity pool within the resource group.
Create or Update a capacity pool.
@@ -285,17 +301,20 @@ async def begin_create_or_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.CapacityPool]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_or_update_initial(
+ raw_result = await self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -303,20 +322,27 @@ async def begin_create_or_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('CapacityPool', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -334,17 +360,20 @@ async def _update_initial(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPoolPatch",
+ body: _models.CapacityPoolPatch,
**kwargs: Any
- ) -> Optional["_models.CapacityPool"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CapacityPool"]]
+ ) -> Optional[_models.CapacityPool]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.CapacityPool]]
_json = self._serialize.body(body, 'CapacityPoolPatch')
@@ -357,11 +386,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -390,9 +421,9 @@ async def begin_update(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPoolPatch",
+ body: _models.CapacityPoolPatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.CapacityPool"]:
+ ) -> AsyncLROPoller[_models.CapacityPool]:
"""Update a capacity pool.
Patch the specified capacity pool.
@@ -418,17 +449,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.CapacityPool]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -436,20 +470,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('CapacityPool', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -469,13 +510,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
pool_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -485,11 +529,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
pool_name=pool_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -536,21 +582,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -560,8 +611,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py
index db7fbd12008c5..9f47758a2e2d6 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshot_policies_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class SnapshotPoliciesOperations:
- """SnapshotPoliciesOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`snapshot_policies` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -53,7 +52,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.SnapshotPoliciesList"]:
+ ) -> AsyncIterable[_models.SnapshotPoliciesList]:
"""List snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -66,13 +65,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.SnapshotPoliciesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPoliciesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPoliciesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -82,9 +84,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -94,9 +98,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -136,7 +142,7 @@ async def get(
account_name: str,
snapshot_policy_name: str,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
+ ) -> _models.SnapshotPolicy:
"""Get a snapshot Policy.
:param resource_group_name: The name of the resource group.
@@ -150,13 +156,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
request = build_get_request(
@@ -166,11 +175,13 @@ async def get(
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -197,9 +208,9 @@ async def create(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicy",
+ body: _models.SnapshotPolicy,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
+ ) -> _models.SnapshotPolicy:
"""Create a snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -215,14 +226,17 @@ async def create(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
_json = self._serialize.body(body, 'SnapshotPolicy')
@@ -235,11 +249,13 @@ async def create(
content_type=content_type,
json=_json,
template_url=self.create.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -269,17 +285,20 @@ async def _update_initial(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicyPatch",
+ body: _models.SnapshotPolicyPatch,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
+ ) -> _models.SnapshotPolicy:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
_json = self._serialize.body(body, 'SnapshotPolicyPatch')
@@ -292,11 +311,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -327,9 +348,9 @@ async def begin_update(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicyPatch",
+ body: _models.SnapshotPolicyPatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.SnapshotPolicy"]:
+ ) -> AsyncLROPoller[_models.SnapshotPolicy]:
"""Patch a snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -353,17 +374,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SnapshotPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
snapshot_policy_name=snapshot_policy_name,
@@ -371,20 +395,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SnapshotPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -404,13 +435,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_policy_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -420,11 +454,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -469,21 +505,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -493,8 +534,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -514,7 +561,7 @@ async def list_volumes(
account_name: str,
snapshot_policy_name: str,
**kwargs: Any
- ) -> "_models.SnapshotPolicyVolumeList":
+ ) -> _models.SnapshotPolicyVolumeList:
"""Get volumes for snapshot policy.
Get volumes associated with snapshot policy.
@@ -530,13 +577,16 @@ async def list_volumes(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicyVolumeList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicyVolumeList]
request = build_list_volumes_request(
@@ -546,11 +596,13 @@ async def list_volumes(
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self.list_volumes.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py
index feaec4e741d33..3c7d6c0650497 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_snapshots_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class SnapshotsOperations:
- """SnapshotsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`snapshots` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -55,7 +54,7 @@ def list(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.SnapshotsList"]:
+ ) -> AsyncIterable[_models.SnapshotsList]:
"""Describe all snapshots.
List all snapshots associated with the volume.
@@ -73,13 +72,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.SnapshotsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -91,9 +93,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -105,9 +109,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -149,7 +155,7 @@ async def get(
volume_name: str,
snapshot_name: str,
**kwargs: Any
- ) -> "_models.Snapshot":
+ ) -> _models.Snapshot:
"""Describe a snapshot.
Get details of the specified snapshot.
@@ -169,13 +175,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.Snapshot
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
request = build_get_request(
@@ -187,11 +196,13 @@ async def get(
snapshot_name=snapshot_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -219,17 +230,20 @@ async def _create_initial(
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.Snapshot",
+ body: _models.Snapshot,
**kwargs: Any
- ) -> Optional["_models.Snapshot"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Snapshot"]]
+ ) -> Optional[_models.Snapshot]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Snapshot]]
_json = self._serialize.body(body, 'Snapshot')
@@ -244,11 +258,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -279,9 +295,9 @@ async def begin_create(
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.Snapshot",
+ body: _models.Snapshot,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Snapshot"]:
+ ) -> AsyncLROPoller[_models.Snapshot]:
"""Create a snapshot.
Create the specified snapshot within the given volume.
@@ -311,17 +327,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Snapshot]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -331,20 +350,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Snapshot', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -366,15 +392,18 @@ async def _update_initial(
snapshot_name: str,
body: Any,
**kwargs: Any
- ) -> Optional["_models.Snapshot"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Snapshot"]]
+ ) -> Optional[_models.Snapshot]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Snapshot]]
_json = self._serialize.body(body, 'object')
@@ -389,11 +418,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -426,7 +457,7 @@ async def begin_update(
snapshot_name: str,
body: Any,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Snapshot"]:
+ ) -> AsyncLROPoller[_models.Snapshot]:
"""Update a snapshot.
Patch a snapshot.
@@ -456,17 +487,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Snapshot]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -476,20 +510,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Snapshot', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -511,13 +552,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -529,11 +573,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_name=snapshot_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -586,16 +632,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -603,6 +652,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
snapshot_name=snapshot_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -612,8 +663,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -633,17 +690,20 @@ async def _restore_files_initial( # pylint: disable=inconsistent-return-stateme
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.SnapshotRestoreFiles",
+ body: _models.SnapshotRestoreFiles,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'SnapshotRestoreFiles')
@@ -658,11 +718,13 @@ async def _restore_files_initial( # pylint: disable=inconsistent-return-stateme
content_type=content_type,
json=_json,
template_url=self._restore_files_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -687,7 +749,7 @@ async def begin_restore_files( # pylint: disable=inconsistent-return-statements
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.SnapshotRestoreFiles",
+ body: _models.SnapshotRestoreFiles,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Create a new Snapshot Restore Files request.
@@ -718,17 +780,20 @@ async def begin_restore_files( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._restore_files_initial(
+ raw_result = await self._restore_files_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -738,6 +803,8 @@ async def begin_restore_files( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -747,8 +814,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py
index 69a43906ad001..d140b51af2455 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_subvolumes_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class SubvolumesOperations:
- """SubvolumesOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`subvolumes` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_volume(
@@ -55,7 +54,7 @@ def list_by_volume(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.SubvolumesList"]:
+ ) -> AsyncIterable[_models.SubvolumesList]:
"""List of all the subvolumes.
Returns a list of the subvolumes in the volume.
@@ -73,13 +72,16 @@ def list_by_volume(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.SubvolumesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -91,9 +93,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_by_volume.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -105,9 +109,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -149,7 +155,7 @@ async def get(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> "_models.SubvolumeInfo":
+ ) -> _models.SubvolumeInfo:
"""Get the path associated with the subvolumeName.
Returns the path associated with the subvolumeName provided.
@@ -169,13 +175,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.SubvolumeInfo
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
request = build_get_request(
@@ -187,11 +196,13 @@ async def get(
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -219,17 +230,20 @@ async def _create_initial(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumeInfo",
+ body: _models.SubvolumeInfo,
**kwargs: Any
- ) -> Optional["_models.SubvolumeInfo"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]]
+ ) -> Optional[_models.SubvolumeInfo]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeInfo]]
_json = self._serialize.body(body, 'SubvolumeInfo')
@@ -244,11 +258,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -282,9 +298,9 @@ async def begin_create(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumeInfo",
+ body: _models.SubvolumeInfo,
**kwargs: Any
- ) -> AsyncLROPoller["_models.SubvolumeInfo"]:
+ ) -> AsyncLROPoller[_models.SubvolumeInfo]:
"""Create or clone a new subvolume.
Creates a subvolume in the path or clones the subvolume mentioned in the parentPath.
@@ -314,17 +330,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeInfo]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -334,20 +353,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeInfo', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -367,17 +393,20 @@ async def _update_initial(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumePatchRequest",
+ body: _models.SubvolumePatchRequest,
**kwargs: Any
- ) -> Optional["_models.SubvolumeInfo"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]]
+ ) -> Optional[_models.SubvolumeInfo]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeInfo]]
_json = self._serialize.body(body, 'SubvolumePatchRequest')
@@ -392,11 +421,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -427,9 +458,9 @@ async def begin_update(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumePatchRequest",
+ body: _models.SubvolumePatchRequest,
**kwargs: Any
- ) -> AsyncLROPoller["_models.SubvolumeInfo"]:
+ ) -> AsyncLROPoller[_models.SubvolumeInfo]:
"""Update a subvolume.
Patch a subvolume.
@@ -459,17 +490,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeInfo]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -479,20 +513,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeInfo', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -514,13 +555,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
subvolume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -532,11 +576,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -589,16 +635,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -606,6 +655,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
subvolume_name=subvolume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -615,8 +666,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -637,14 +694,17 @@ async def _get_metadata_initial(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> Optional["_models.SubvolumeModel"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeModel"]]
+ ) -> Optional[_models.SubvolumeModel]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeModel]]
request = build_get_metadata_request_initial(
@@ -656,11 +716,13 @@ async def _get_metadata_initial(
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self._get_metadata_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -692,7 +754,7 @@ async def begin_get_metadata(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> AsyncLROPoller["_models.SubvolumeModel"]:
+ ) -> AsyncLROPoller[_models.SubvolumeModel]:
"""Describe a subvolume.
Get details of the specified subvolume.
@@ -720,16 +782,19 @@ async def begin_get_metadata(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.SubvolumeModel]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeModel]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeModel"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._get_metadata_initial(
+ raw_result = await self._get_metadata_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -737,20 +802,27 @@ async def begin_get_metadata(
subvolume_name=subvolume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeModel', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py
index bab2770dbd8ae..821a2356c8c23 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_vaults_operations.py
@@ -14,6 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
@@ -23,26 +24,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class VaultsOperations:
- """VaultsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`vaults` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -50,7 +49,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.VaultList"]:
+ ) -> AsyncIterable[_models.VaultList]:
"""List vaults.
List vaults for a Netapp Account.
@@ -64,13 +63,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.VaultList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VaultList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -80,9 +82,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -92,9 +96,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py
index f761019d2fda4..9e37895670f02 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_groups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class VolumeGroupsOperations:
- """VolumeGroupsOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`volume_groups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_net_app_account(
@@ -53,7 +52,7 @@ def list_by_net_app_account(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.VolumeGroupList"]:
+ ) -> AsyncIterable[_models.VolumeGroupList]:
"""Describe all volume groups.
List all volume groups for given account.
@@ -67,13 +66,16 @@ def list_by_net_app_account(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.VolumeGroupList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -83,9 +85,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list_by_net_app_account.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -95,9 +99,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -137,7 +143,7 @@ async def get(
account_name: str,
volume_group_name: str,
**kwargs: Any
- ) -> "_models.VolumeGroupDetails":
+ ) -> _models.VolumeGroupDetails:
"""Describe a Volume Group.
Get details of the specified volume group.
@@ -153,13 +159,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
request = build_get_request(
@@ -169,11 +178,13 @@ async def get(
volume_group_name=volume_group_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -199,17 +210,20 @@ async def _create_initial(
resource_group_name: str,
account_name: str,
volume_group_name: str,
- body: "_models.VolumeGroupDetails",
+ body: _models.VolumeGroupDetails,
**kwargs: Any
- ) -> "_models.VolumeGroupDetails":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
+ ) -> _models.VolumeGroupDetails:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
_json = self._serialize.body(body, 'VolumeGroupDetails')
@@ -222,11 +236,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -253,9 +269,9 @@ async def begin_create(
resource_group_name: str,
account_name: str,
volume_group_name: str,
- body: "_models.VolumeGroupDetails",
+ body: _models.VolumeGroupDetails,
**kwargs: Any
- ) -> AsyncLROPoller["_models.VolumeGroupDetails"]:
+ ) -> AsyncLROPoller[_models.VolumeGroupDetails]:
"""Create the specified volume group and volumes. Creating volume group will create all the
volumes specified in request body implicitly. Once volumes are created using volume group,
those will be treated as regular volumes thereafter.
@@ -283,17 +299,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
volume_group_name=volume_group_name,
@@ -301,20 +320,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeGroupDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -334,13 +360,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_group_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -350,11 +379,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_group_name=volume_group_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -401,21 +432,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
volume_group_name=volume_group_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -425,8 +461,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py
index 14e799013ad84..77233b898b5db 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volume_quota_rules_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,6 +16,7 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
@@ -26,26 +27,24 @@
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class VolumeQuotaRulesOperations:
- """VolumeQuotaRulesOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`volume_quota_rules` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_volume(
@@ -55,7 +54,7 @@ def list_by_volume(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.VolumeQuotaRulesList"]:
+ ) -> AsyncIterable[_models.VolumeQuotaRulesList]:
"""Get all quota rules for a volume.
List all quota rules associated with the volume.
@@ -74,13 +73,16 @@ def list_by_volume(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.VolumeQuotaRulesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRulesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRulesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -92,9 +94,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_by_volume.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -106,9 +110,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -150,7 +156,7 @@ async def get(
volume_name: str,
volume_quota_rule_name: str,
**kwargs: Any
- ) -> "_models.VolumeQuotaRule":
+ ) -> _models.VolumeQuotaRule:
"""Describe a quota rule.
Get details of the specified quota rule.
@@ -170,13 +176,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
request = build_get_request(
@@ -188,11 +197,13 @@ async def get(
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -220,17 +231,20 @@ async def _create_initial(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRule",
+ body: _models.VolumeQuotaRule,
**kwargs: Any
- ) -> "_models.VolumeQuotaRule":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
+ ) -> _models.VolumeQuotaRule:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
_json = self._serialize.body(body, 'VolumeQuotaRule')
@@ -245,11 +259,13 @@ async def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -282,9 +298,9 @@ async def begin_create(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRule",
+ body: _models.VolumeQuotaRule,
**kwargs: Any
- ) -> AsyncLROPoller["_models.VolumeQuotaRule"]:
+ ) -> AsyncLROPoller[_models.VolumeQuotaRule]:
"""Create a quota rule.
Create the specified quota rule within the given volume.
@@ -314,17 +330,20 @@ async def begin_create(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_initial(
+ raw_result = await self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -334,20 +353,27 @@ async def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeQuotaRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -367,17 +393,20 @@ async def _update_initial(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRulePatch",
+ body: _models.VolumeQuotaRulePatch,
**kwargs: Any
- ) -> Optional["_models.VolumeQuotaRule"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VolumeQuotaRule"]]
+ ) -> Optional[_models.VolumeQuotaRule]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.VolumeQuotaRule]]
_json = self._serialize.body(body, 'VolumeQuotaRulePatch')
@@ -392,11 +421,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -427,9 +458,9 @@ async def begin_update(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRulePatch",
+ body: _models.VolumeQuotaRulePatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.VolumeQuotaRule"]:
+ ) -> AsyncLROPoller[_models.VolumeQuotaRule]:
"""Update a quota rule.
Patch a quota rule.
@@ -459,17 +490,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -479,20 +513,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeQuotaRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -514,13 +555,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -532,11 +576,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -589,16 +635,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -606,6 +655,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -615,8 +666,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py
index 25b6da9bcd136..5d0728ba97a8c 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_volumes_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
@@ -16,36 +16,35 @@
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
from ..._vendor import _convert_request
-from ...operations._volumes_operations import build_authorize_replication_request_initial, build_break_replication_request_initial, build_create_or_update_request_initial, build_delete_replication_request_initial, build_delete_request_initial, build_finalize_relocation_request_initial, build_get_request, build_list_replications_request, build_list_request, build_pool_change_request_initial, build_re_initialize_replication_request_initial, build_relocate_request_initial, build_replication_status_request, build_reset_cifs_password_request_initial, build_resync_replication_request_initial, build_revert_relocation_request_initial, build_revert_request_initial, build_update_request_initial
+from ...operations._volumes_operations import build_authorize_replication_request_initial, build_break_replication_request_initial, build_create_or_update_request_initial, build_delete_replication_request_initial, build_delete_request_initial, build_finalize_relocation_request_initial, build_get_request, build_list_replications_request, build_list_request, build_pool_change_request_initial, build_re_initialize_replication_request_initial, build_reestablish_replication_request_initial, build_relocate_request_initial, build_replication_status_request, build_reset_cifs_password_request_initial, build_resync_replication_request_initial, build_revert_relocation_request_initial, build_revert_request_initial, build_update_request_initial
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class VolumesOperations: # pylint: disable=too-many-public-methods
- """VolumesOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.aio.NetAppManagementClient`'s
+ :attr:`volumes` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -54,7 +53,7 @@ def list(
account_name: str,
pool_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.VolumeList"]:
+ ) -> AsyncIterable[_models.VolumeList]:
"""Describe all volumes.
List all volumes within the capacity pool.
@@ -70,13 +69,16 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.VolumeList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -87,9 +89,11 @@ def prepare_request(next_link=None):
pool_name=pool_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -100,9 +104,11 @@ def prepare_request(next_link=None):
pool_name=pool_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -143,7 +149,7 @@ async def get(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.Volume":
+ ) -> _models.Volume:
"""Describe a volume.
Get the details of the specified volume.
@@ -161,13 +167,16 @@ async def get(
:rtype: ~azure.mgmt.netapp.models.Volume
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
request = build_get_request(
@@ -178,11 +187,13 @@ async def get(
volume_name=volume_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -209,17 +220,20 @@ async def _create_or_update_initial(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.Volume",
+ body: _models.Volume,
**kwargs: Any
- ) -> Optional["_models.Volume"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Volume"]]
+ ) -> Optional[_models.Volume]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Volume]]
_json = self._serialize.body(body, 'Volume')
@@ -233,11 +247,13 @@ async def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -270,9 +286,9 @@ async def begin_create_or_update(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.Volume",
+ body: _models.Volume,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Volume"]:
+ ) -> AsyncLROPoller[_models.Volume]:
"""Create or Update a volume.
Create or update the specified volume within the capacity pool.
@@ -300,17 +316,20 @@ async def begin_create_or_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Volume]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._create_or_update_initial(
+ raw_result = await self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -319,20 +338,27 @@ async def begin_create_or_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Volume', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -351,17 +377,20 @@ async def _update_initial(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumePatch",
+ body: _models.VolumePatch,
**kwargs: Any
- ) -> Optional["_models.Volume"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Volume"]]
+ ) -> Optional[_models.Volume]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Volume]]
_json = self._serialize.body(body, 'VolumePatch')
@@ -375,11 +404,13 @@ async def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -409,9 +440,9 @@ async def begin_update(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumePatch",
+ body: _models.VolumePatch,
**kwargs: Any
- ) -> AsyncLROPoller["_models.Volume"]:
+ ) -> AsyncLROPoller[_models.Volume]:
"""Update a volume.
Patch the specified volume.
@@ -439,17 +470,20 @@ async def begin_update(
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.netapp.models.Volume]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._update_initial(
+ raw_result = await self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -458,20 +492,27 @@ async def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Volume', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -493,13 +534,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
force_delete: Optional[bool] = None,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -511,11 +555,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
api_version=api_version,
force_delete=force_delete,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -569,16 +615,19 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_initial(
+ raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -586,6 +635,8 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements
force_delete=force_delete,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -595,8 +646,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -615,17 +672,20 @@ async def _revert_initial( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumeRevert",
+ body: _models.VolumeRevert,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'VolumeRevert')
@@ -639,11 +699,13 @@ async def _revert_initial( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
template_url=self._revert_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -667,7 +729,7 @@ async def begin_revert( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumeRevert",
+ body: _models.VolumeRevert,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Revert a volume to one of its snapshots.
@@ -696,17 +758,20 @@ async def begin_revert( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._revert_initial(
+ raw_result = await self._revert_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -715,6 +780,8 @@ async def begin_revert( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -724,8 +791,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -746,13 +819,16 @@ async def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-s
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_reset_cifs_password_request_initial(
@@ -763,11 +839,13 @@ async def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-s
volume_name=volume_name,
api_version=api_version,
template_url=self._reset_cifs_password_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -817,22 +895,27 @@ async def begin_reset_cifs_password( # pylint: disable=inconsistent-return-stat
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._reset_cifs_password_initial(
+ raw_result = await self._reset_cifs_password_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -842,8 +925,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -862,17 +951,20 @@ async def _break_replication_initial( # pylint: disable=inconsistent-return-sta
account_name: str,
pool_name: str,
volume_name: str,
- body: Optional["_models.BreakReplicationRequest"] = None,
+ body: Optional[_models.BreakReplicationRequest] = None,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
if body is not None:
_json = self._serialize.body(body, 'BreakReplicationRequest')
@@ -889,11 +981,13 @@ async def _break_replication_initial( # pylint: disable=inconsistent-return-sta
content_type=content_type,
json=_json,
template_url=self._break_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -917,7 +1011,7 @@ async def begin_break_replication( # pylint: disable=inconsistent-return-statem
account_name: str,
pool_name: str,
volume_name: str,
- body: Optional["_models.BreakReplicationRequest"] = None,
+ body: Optional[_models.BreakReplicationRequest] = None,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Break volume replication.
@@ -946,17 +1040,20 @@ async def begin_break_replication( # pylint: disable=inconsistent-return-statem
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._break_replication_initial(
+ raw_result = await self._break_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -965,6 +1062,8 @@ async def begin_break_replication( # pylint: disable=inconsistent-return-statem
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -974,8 +1073,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -988,6 +1093,152 @@ def get_long_running_output(pipeline_response):
begin_break_replication.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication"} # type: ignore
+ async def _reestablish_replication_initial( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ account_name: str,
+ pool_name: str,
+ volume_name: str,
+ body: _models.ReestablishReplicationRequest,
+ **kwargs: Any
+ ) -> None:
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+
+ _json = self._serialize.body(body, 'ReestablishReplicationRequest')
+
+ request = build_reestablish_replication_request_initial(
+ subscription_id=self._config.subscription_id,
+ resource_group_name=resource_group_name,
+ account_name=account_name,
+ pool_name=pool_name,
+ volume_name=volume_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ template_url=self._reestablish_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url) # type: ignore
+
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
+ request,
+ stream=False,
+ **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _reestablish_replication_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication"} # type: ignore
+
+
+ @distributed_trace_async
+ async def begin_reestablish_replication( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ account_name: str,
+ pool_name: str,
+ volume_name: str,
+ body: _models.ReestablishReplicationRequest,
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Re-establish volume replication.
+
+ Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or
+ policy-based snapshots.
+
+ :param resource_group_name: The name of the resource group.
+ :type resource_group_name: str
+ :param account_name: The name of the NetApp account.
+ :type account_name: str
+ :param pool_name: The name of the capacity pool.
+ :type pool_name: str
+ :param volume_name: The name of the volume.
+ :type volume_name: str
+ :param body: body for the id of the source volume.
+ :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
+ this operation to not poll, or pass in your own initialized polling object for a personal
+ polling strategy.
+ :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = await self._reestablish_replication_initial( # type: ignore
+ resource_group_name=resource_group_name,
+ account_name=account_name,
+ pool_name=pool_name,
+ volume_name=volume_name,
+ body=body,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop('error_map', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else: polling_method = polling
+ if cont_token:
+ return AsyncLROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
+
+ begin_reestablish_replication.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication"} # type: ignore
+
@distributed_trace_async
async def replication_status(
self,
@@ -996,7 +1247,7 @@ async def replication_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.ReplicationStatus":
+ ) -> _models.ReplicationStatus:
"""Get volume replication status.
Get the status of the replication.
@@ -1014,13 +1265,16 @@ async def replication_status(
:rtype: ~azure.mgmt.netapp.models.ReplicationStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.ReplicationStatus]
request = build_replication_status_request(
@@ -1031,11 +1285,13 @@ async def replication_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.replication_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1064,7 +1320,7 @@ def list_replications(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> AsyncIterable["_models.ListReplications"]:
+ ) -> AsyncIterable[_models.ListReplications]:
"""List replications for volume.
List all replications for a specified volume.
@@ -1082,13 +1338,16 @@ def list_replications(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.netapp.models.ListReplications]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.ListReplications]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.ListReplications"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -1100,9 +1359,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_replications.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -1114,9 +1375,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -1157,13 +1420,16 @@ async def _resync_replication_initial( # pylint: disable=inconsistent-return-st
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_resync_replication_request_initial(
@@ -1174,11 +1440,13 @@ async def _resync_replication_initial( # pylint: disable=inconsistent-return-st
volume_name=volume_name,
api_version=api_version,
template_url=self._resync_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1229,22 +1497,27 @@ async def begin_resync_replication( # pylint: disable=inconsistent-return-state
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._resync_replication_initial(
+ raw_result = await self._resync_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1254,8 +1527,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1276,13 +1555,16 @@ async def _delete_replication_initial( # pylint: disable=inconsistent-return-st
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_replication_request_initial(
@@ -1293,11 +1575,13 @@ async def _delete_replication_initial( # pylint: disable=inconsistent-return-st
volume_name=volume_name,
api_version=api_version,
template_url=self._delete_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1348,22 +1632,27 @@ async def begin_delete_replication( # pylint: disable=inconsistent-return-state
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._delete_replication_initial(
+ raw_result = await self._delete_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1373,8 +1662,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1393,17 +1688,20 @@ async def _authorize_replication_initial( # pylint: disable=inconsistent-return
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.AuthorizeRequest",
+ body: _models.AuthorizeRequest,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'AuthorizeRequest')
@@ -1417,11 +1715,13 @@ async def _authorize_replication_initial( # pylint: disable=inconsistent-return
content_type=content_type,
json=_json,
template_url=self._authorize_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1445,7 +1745,7 @@ async def begin_authorize_replication( # pylint: disable=inconsistent-return-st
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.AuthorizeRequest",
+ body: _models.AuthorizeRequest,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Authorize source volume replication.
@@ -1474,17 +1774,20 @@ async def begin_authorize_replication( # pylint: disable=inconsistent-return-st
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._authorize_replication_initial(
+ raw_result = await self._authorize_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1493,6 +1796,8 @@ async def begin_authorize_replication( # pylint: disable=inconsistent-return-st
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1502,8 +1807,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1524,13 +1835,16 @@ async def _re_initialize_replication_initial( # pylint: disable=inconsistent-re
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_re_initialize_replication_request_initial(
@@ -1541,11 +1855,13 @@ async def _re_initialize_replication_initial( # pylint: disable=inconsistent-re
volume_name=volume_name,
api_version=api_version,
template_url=self._re_initialize_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1595,22 +1911,27 @@ async def begin_re_initialize_replication( # pylint: disable=inconsistent-retur
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._re_initialize_replication_initial(
+ raw_result = await self._re_initialize_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1620,8 +1941,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1640,17 +1967,20 @@ async def _pool_change_initial( # pylint: disable=inconsistent-return-statement
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.PoolChangeRequest",
+ body: _models.PoolChangeRequest,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'PoolChangeRequest')
@@ -1664,11 +1994,13 @@ async def _pool_change_initial( # pylint: disable=inconsistent-return-statement
content_type=content_type,
json=_json,
template_url=self._pool_change_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1692,7 +2024,7 @@ async def begin_pool_change( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.PoolChangeRequest",
+ body: _models.PoolChangeRequest,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Change pool for volume.
@@ -1721,17 +2053,20 @@ async def begin_pool_change( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._pool_change_initial(
+ raw_result = await self._pool_change_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1740,6 +2075,8 @@ async def begin_pool_change( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1749,8 +2086,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1771,13 +2114,16 @@ async def _relocate_initial( # pylint: disable=inconsistent-return-statements
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_relocate_request_initial(
@@ -1788,11 +2134,13 @@ async def _relocate_initial( # pylint: disable=inconsistent-return-statements
volume_name=volume_name,
api_version=api_version,
template_url=self._relocate_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1842,22 +2190,27 @@ async def begin_relocate( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._relocate_initial(
+ raw_result = await self._relocate_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1867,8 +2220,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -1889,13 +2248,16 @@ async def _finalize_relocation_initial( # pylint: disable=inconsistent-return-s
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_finalize_relocation_request_initial(
@@ -1906,11 +2268,13 @@ async def _finalize_relocation_initial( # pylint: disable=inconsistent-return-s
volume_name=volume_name,
api_version=api_version,
template_url=self._finalize_relocation_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1960,22 +2324,27 @@ async def begin_finalize_relocation( # pylint: disable=inconsistent-return-stat
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._finalize_relocation_initial(
+ raw_result = await self._finalize_relocation_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1985,8 +2354,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
@@ -2007,13 +2382,16 @@ async def _revert_relocation_initial( # pylint: disable=inconsistent-return-sta
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_revert_relocation_request_initial(
@@ -2024,11 +2402,13 @@ async def _revert_relocation_initial( # pylint: disable=inconsistent-return-sta
volume_name=volume_name,
api_version=api_version,
template_url=self._revert_relocation_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2079,22 +2459,27 @@ async def begin_revert_relocation( # pylint: disable=inconsistent-return-statem
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = await self._revert_relocation_initial(
+ raw_result = await self._revert_relocation_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2104,8 +2489,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = AsyncNoPolling()
+ if polling is True:
+ polling_method = cast(AsyncPollingMethod, AsyncARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: AsyncPollingMethod
+ elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py
index 90b0480a014ca..a050d635b1a03 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py
@@ -45,6 +45,7 @@
from ._models_py3 import PoolChangeRequest
from ._models_py3 import ProxyResource
from ._models_py3 import QuotaAvailabilityRequest
+from ._models_py3 import ReestablishReplicationRequest
from ._models_py3 import Replication
from ._models_py3 import ReplicationObject
from ._models_py3 import ReplicationStatus
@@ -120,7 +121,9 @@
Type,
VolumeStorageToNetworkProximity,
)
-
+from ._patch import __all__ as _patch_all
+from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
+from ._patch import patch_sdk as _patch_sdk
__all__ = [
'AccountEncryption',
'ActiveDirectory',
@@ -161,6 +164,7 @@
'PoolChangeRequest',
'ProxyResource',
'QuotaAvailabilityRequest',
+ 'ReestablishReplicationRequest',
'Replication',
'ReplicationObject',
'ReplicationStatus',
@@ -233,3 +237,5 @@
'Type',
'VolumeStorageToNetworkProximity',
]
+__all__.extend([p for p in _patch_all if p not in __all__])
+_patch_sdk()
\ No newline at end of file
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py
index 2f215e1e7fb87..6a3ee35fc1d75 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_models_py3.py
@@ -7,11 +7,13 @@
# --------------------------------------------------------------------------
import datetime
-from typing import Dict, List, Optional, Union
+from typing import Dict, List, Optional, TYPE_CHECKING, Union
import msrest.serialization
-from ._net_app_management_client_enums import *
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ import __init__ as _models
class AccountEncryption(msrest.serialization.Model):
@@ -56,8 +58,8 @@ class ActiveDirectory(msrest.serialization.Model):
:ivar dns: Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory
domain.
:vartype dns: str
- :ivar status: Status of the Active Directory. Possible values include: "Created", "InUse",
- "Deleted", "Error", "Updating".
+ :ivar status: Status of the Active Directory. Known values are: "Created", "InUse", "Deleted",
+ "Error", "Updating".
:vartype status: str or ~azure.mgmt.netapp.models.ActiveDirectoryStatus
:ivar status_details: Any details in regards to the Status of the Active Directory.
:vartype status_details: str
@@ -161,7 +163,7 @@ def __init__(
ldap_over_tls: Optional[bool] = None,
allow_local_nfs_users_with_ldap: Optional[bool] = None,
encrypt_dc_connections: Optional[bool] = None,
- ldap_search_scope: Optional["LdapSearchScopeOpt"] = None,
+ ldap_search_scope: Optional["_models.LdapSearchScopeOpt"] = None,
**kwargs
):
"""
@@ -295,8 +297,7 @@ class Backup(msrest.serialization.Model):
:vartype size: long
:ivar label: Label for backup.
:vartype label: str
- :ivar backup_type: Type of backup Manual or Scheduled. Possible values include: "Manual",
- "Scheduled".
+ :ivar backup_type: Type of backup Manual or Scheduled. Known values are: "Manual", "Scheduled".
:vartype backup_type: str or ~azure.mgmt.netapp.models.BackupType
:ivar failure_reason: Failure reason.
:vartype failure_reason: str
@@ -387,8 +388,7 @@ class BackupPatch(msrest.serialization.Model):
:vartype size: long
:ivar label: Label for backup.
:vartype label: str
- :ivar backup_type: Type of backup Manual or Scheduled. Possible values include: "Manual",
- "Scheduled".
+ :ivar backup_type: Type of backup Manual or Scheduled. Known values are: "Manual", "Scheduled".
:vartype backup_type: str or ~azure.mgmt.netapp.models.BackupType
:ivar failure_reason: Failure reason.
:vartype failure_reason: str
@@ -466,7 +466,7 @@ class BackupPoliciesList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["BackupPolicy"]] = None,
+ value: Optional[List["_models.BackupPolicy"]] = None,
**kwargs
):
"""
@@ -905,7 +905,7 @@ class BackupsList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Backup"]] = None,
+ value: Optional[List["_models.Backup"]] = None,
**kwargs
):
"""
@@ -923,11 +923,11 @@ class BackupStatus(msrest.serialization.Model):
:ivar healthy: Backup health status.
:vartype healthy: bool
- :ivar relationship_status: Status of the backup mirror relationship. Possible values include:
- "Idle", "Transferring".
+ :ivar relationship_status: Status of the backup mirror relationship. Known values are: "Idle",
+ "Transferring".
:vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus
- :ivar mirror_state: The status of the backup. Possible values include: "Uninitialized",
- "Mirrored", "Broken".
+ :ivar mirror_state: The status of the backup. Known values are: "Uninitialized", "Mirrored",
+ "Broken".
:vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState
:ivar unhealthy_reason: Reason for the unhealthy backup relationship.
:vartype unhealthy_reason: str
@@ -1036,22 +1036,22 @@ class CapacityPool(TrackedResource):
:ivar size: Required. Provisioned size of the pool (in bytes). Allowed values are in 1TiB
chunks (value must be multiply of 4398046511104).
:vartype size: long
- :ivar service_level: Required. The service level of the file system. Possible values include:
+ :ivar service_level: Required. The service level of the file system. Known values are:
"Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
:vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar provisioning_state: Azure lifecycle management.
:vartype provisioning_state: str
- :ivar total_throughput_mibps: Total throughput of pool in Mibps.
+ :ivar total_throughput_mibps: Total throughput of pool in MiB/s.
:vartype total_throughput_mibps: float
- :ivar utilized_throughput_mibps: Utilized throughput of pool in Mibps.
+ :ivar utilized_throughput_mibps: Utilized throughput of pool in MiB/s.
:vartype utilized_throughput_mibps: float
- :ivar qos_type: The qos type of the pool. Possible values include: "Auto", "Manual".
+ :ivar qos_type: The qos type of the pool. Known values are: "Auto", "Manual".
:vartype qos_type: str or ~azure.mgmt.netapp.models.QosType
:ivar cool_access: If enabled (true) the pool can contain cool Access enabled volumes.
:vartype cool_access: bool
:ivar encryption_type: Encryption type of the capacity pool, set encryption type for data at
rest for this pool and all volumes in it. This value can only be set when creating new pool.
- Possible values include: "Single", "Double". Default value: "Single".
+ Known values are: "Single", "Double". Default value: "Single".
:vartype encryption_type: str or ~azure.mgmt.netapp.models.EncryptionType
"""
@@ -1094,11 +1094,11 @@ def __init__(
*,
location: str,
size: int = 4398046511104,
- service_level: Union[str, "ServiceLevel"] = "Premium",
+ service_level: Union[str, "_models.ServiceLevel"] = "Premium",
tags: Optional[Dict[str, str]] = None,
- qos_type: Optional[Union[str, "QosType"]] = None,
+ qos_type: Optional[Union[str, "_models.QosType"]] = None,
cool_access: Optional[bool] = False,
- encryption_type: Optional[Union[str, "EncryptionType"]] = "Single",
+ encryption_type: Optional[Union[str, "_models.EncryptionType"]] = "Single",
**kwargs
):
"""
@@ -1109,16 +1109,16 @@ def __init__(
:keyword size: Required. Provisioned size of the pool (in bytes). Allowed values are in 1TiB
chunks (value must be multiply of 4398046511104).
:paramtype size: long
- :keyword service_level: Required. The service level of the file system. Possible values
- include: "Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
+ :keyword service_level: Required. The service level of the file system. Known values are:
+ "Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
:paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
- :keyword qos_type: The qos type of the pool. Possible values include: "Auto", "Manual".
+ :keyword qos_type: The qos type of the pool. Known values are: "Auto", "Manual".
:paramtype qos_type: str or ~azure.mgmt.netapp.models.QosType
:keyword cool_access: If enabled (true) the pool can contain cool Access enabled volumes.
:paramtype cool_access: bool
:keyword encryption_type: Encryption type of the capacity pool, set encryption type for data at
rest for this pool and all volumes in it. This value can only be set when creating new pool.
- Possible values include: "Single", "Double". Default value: "Single".
+ Known values are: "Single", "Double". Default value: "Single".
:paramtype encryption_type: str or ~azure.mgmt.netapp.models.EncryptionType
"""
super(CapacityPool, self).__init__(tags=tags, location=location, **kwargs)
@@ -1151,7 +1151,7 @@ class CapacityPoolList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["CapacityPool"]] = None,
+ value: Optional[List["_models.CapacityPool"]] = None,
next_link: Optional[str] = None,
**kwargs
):
@@ -1184,8 +1184,10 @@ class CapacityPoolPatch(msrest.serialization.Model):
:ivar size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value
must be multiply of 4398046511104).
:vartype size: long
- :ivar qos_type: The qos type of the pool. Possible values include: "Auto", "Manual".
+ :ivar qos_type: The qos type of the pool. Known values are: "Auto", "Manual".
:vartype qos_type: str or ~azure.mgmt.netapp.models.QosType
+ :ivar cool_access: If enabled (true) the pool can contain cool Access enabled volumes.
+ :vartype cool_access: bool
"""
_validation = {
@@ -1202,6 +1204,7 @@ class CapacityPoolPatch(msrest.serialization.Model):
'tags': {'key': 'tags', 'type': '{str}'},
'size': {'key': 'properties.size', 'type': 'long'},
'qos_type': {'key': 'properties.qosType', 'type': 'str'},
+ 'cool_access': {'key': 'properties.coolAccess', 'type': 'bool'},
}
def __init__(
@@ -1210,7 +1213,8 @@ def __init__(
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
size: Optional[int] = 4398046511104,
- qos_type: Optional[Union[str, "QosType"]] = None,
+ qos_type: Optional[Union[str, "_models.QosType"]] = None,
+ cool_access: Optional[bool] = None,
**kwargs
):
"""
@@ -1221,8 +1225,10 @@ def __init__(
:keyword size: Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks
(value must be multiply of 4398046511104).
:paramtype size: long
- :keyword qos_type: The qos type of the pool. Possible values include: "Auto", "Manual".
+ :keyword qos_type: The qos type of the pool. Known values are: "Auto", "Manual".
:paramtype qos_type: str or ~azure.mgmt.netapp.models.QosType
+ :keyword cool_access: If enabled (true) the pool can contain cool Access enabled volumes.
+ :paramtype cool_access: bool
"""
super(CapacityPoolPatch, self).__init__(**kwargs)
self.location = location
@@ -1232,6 +1238,7 @@ def __init__(
self.tags = tags
self.size = size
self.qos_type = qos_type
+ self.cool_access = cool_access
class CheckAvailabilityResponse(msrest.serialization.Model):
@@ -1242,8 +1249,7 @@ class CheckAvailabilityResponse(msrest.serialization.Model):
:vartype is_available: bool
:ivar reason: :code:`Invalid
` indicates the name provided does not match Azure App
Service naming requirements. :code:`AlreadyExists
` indicates that the name is
- already in use and is therefore unavailable. Possible values include: "Invalid",
- "AlreadyExists".
+ already in use and is therefore unavailable. Known values are: "Invalid", "AlreadyExists".
:vartype reason: str or ~azure.mgmt.netapp.models.InAvailabilityReasonType
:ivar message: If reason == invalid, provide the user with the reason why the given name is
invalid, and provide the resource naming requirements so that the user can select a valid name.
@@ -1262,7 +1268,7 @@ def __init__(
self,
*,
is_available: Optional[bool] = None,
- reason: Optional[Union[str, "InAvailabilityReasonType"]] = None,
+ reason: Optional[Union[str, "_models.InAvailabilityReasonType"]] = None,
message: Optional[str] = None,
**kwargs
):
@@ -1272,8 +1278,7 @@ def __init__(
:paramtype is_available: bool
:keyword reason: :code:`Invalid
` indicates the name provided does not match Azure
App Service naming requirements. :code:`AlreadyExists
` indicates that the name is
- already in use and is therefore unavailable. Possible values include: "Invalid",
- "AlreadyExists".
+ already in use and is therefore unavailable. Known values are: "Invalid", "AlreadyExists".
:paramtype reason: str or ~azure.mgmt.netapp.models.InAvailabilityReasonType
:keyword message: If reason == invalid, provide the user with the reason why the given name is
invalid, and provide the resource naming requirements so that the user can select a valid name.
@@ -1441,8 +1446,8 @@ class ExportPolicyRule(msrest.serialization.Model):
:vartype has_root_access: bool
:ivar chown_mode: This parameter specifies who is authorized to change the ownership of a file.
restricted - Only root user can change the ownership of the file. unrestricted - Non-root users
- can change ownership of files that they own. Possible values include: "Restricted",
- "Unrestricted". Default value: "Restricted".
+ can change ownership of files that they own. Known values are: "Restricted", "Unrestricted".
+ Default value: "Restricted".
:vartype chown_mode: str or ~azure.mgmt.netapp.models.ChownMode
"""
@@ -1481,7 +1486,7 @@ def __init__(
nfsv41: Optional[bool] = None,
allowed_clients: Optional[str] = None,
has_root_access: Optional[bool] = True,
- chown_mode: Optional[Union[str, "ChownMode"]] = "Restricted",
+ chown_mode: Optional[Union[str, "_models.ChownMode"]] = "Restricted",
**kwargs
):
"""
@@ -1522,7 +1527,7 @@ def __init__(
:paramtype has_root_access: bool
:keyword chown_mode: This parameter specifies who is authorized to change the ownership of a
file. restricted - Only root user can change the ownership of the file. unrestricted - Non-root
- users can change ownership of files that they own. Possible values include: "Restricted",
+ users can change ownership of files that they own. Known values are: "Restricted",
"Unrestricted". Default value: "Restricted".
:paramtype chown_mode: str or ~azure.mgmt.netapp.models.ChownMode
"""
@@ -1685,7 +1690,7 @@ class ListReplications(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Replication"]] = None,
+ value: Optional[List["_models.Replication"]] = None,
**kwargs
):
"""
@@ -1792,13 +1797,13 @@ def __init__(
display_name: Optional[str] = None,
display_description: Optional[str] = None,
unit: Optional[str] = None,
- supported_aggregation_types: Optional[List[Union[str, "MetricAggregationType"]]] = None,
+ supported_aggregation_types: Optional[List[Union[str, "_models.MetricAggregationType"]]] = None,
supported_time_grain_types: Optional[List[str]] = None,
internal_metric_name: Optional[str] = None,
enable_regional_mdm_account: Optional[bool] = None,
source_mdm_account: Optional[str] = None,
source_mdm_namespace: Optional[str] = None,
- dimensions: Optional[List["Dimension"]] = None,
+ dimensions: Optional[List["_models.Dimension"]] = None,
aggregation_type: Optional[str] = None,
fill_gap_with_zero: Optional[bool] = None,
category: Optional[str] = None,
@@ -2106,8 +2111,8 @@ def __init__(
*,
location: str,
tags: Optional[Dict[str, str]] = None,
- active_directories: Optional[List["ActiveDirectory"]] = None,
- encryption: Optional["AccountEncryption"] = None,
+ active_directories: Optional[List["_models.ActiveDirectory"]] = None,
+ encryption: Optional["_models.AccountEncryption"] = None,
**kwargs
):
"""
@@ -2144,7 +2149,7 @@ class NetAppAccountList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["NetAppAccount"]] = None,
+ value: Optional[List["_models.NetAppAccount"]] = None,
next_link: Optional[str] = None,
**kwargs
):
@@ -2205,8 +2210,8 @@ def __init__(
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
- active_directories: Optional[List["ActiveDirectory"]] = None,
- encryption: Optional["AccountEncryption"] = None,
+ active_directories: Optional[List["_models.ActiveDirectory"]] = None,
+ encryption: Optional["_models.AccountEncryption"] = None,
**kwargs
):
"""
@@ -2254,9 +2259,9 @@ def __init__(
self,
*,
name: Optional[str] = None,
- display: Optional["OperationDisplay"] = None,
+ display: Optional["_models.OperationDisplay"] = None,
origin: Optional[str] = None,
- service_specification: Optional["ServiceSpecification"] = None,
+ service_specification: Optional["_models.ServiceSpecification"] = None,
**kwargs
):
"""
@@ -2336,7 +2341,7 @@ class OperationListResult(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Operation"]] = None,
+ value: Optional[List["_models.Operation"]] = None,
**kwargs
):
"""
@@ -2469,7 +2474,7 @@ class QuotaAvailabilityRequest(msrest.serialization.Model):
:ivar name: Required. Name of the resource to verify.
:vartype name: str
- :ivar type: Required. Resource type used for verification. Possible values include:
+ :ivar type: Required. Resource type used for verification. Known values are:
"Microsoft.NetApp/netAppAccounts", "Microsoft.NetApp/netAppAccounts/capacityPools",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots".
@@ -2494,14 +2499,14 @@ def __init__(
self,
*,
name: str,
- type: Union[str, "CheckQuotaNameResourceTypes"],
+ type: Union[str, "_models.CheckQuotaNameResourceTypes"],
resource_group: str,
**kwargs
):
"""
:keyword name: Required. Name of the resource to verify.
:paramtype name: str
- :keyword type: Required. Resource type used for verification. Possible values include:
+ :keyword type: Required. Resource type used for verification. Known values are:
"Microsoft.NetApp/netAppAccounts", "Microsoft.NetApp/netAppAccounts/capacityPools",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots".
@@ -2515,16 +2520,40 @@ def __init__(
self.resource_group = resource_group
+class ReestablishReplicationRequest(msrest.serialization.Model):
+ """Re-establish request object supplied in the body of the operation.
+
+ :ivar source_volume_id: Resource id of the source volume for the replication.
+ :vartype source_volume_id: str
+ """
+
+ _attribute_map = {
+ 'source_volume_id': {'key': 'sourceVolumeId', 'type': 'str'},
+ }
+
+ def __init__(
+ self,
+ *,
+ source_volume_id: Optional[str] = None,
+ **kwargs
+ ):
+ """
+ :keyword source_volume_id: Resource id of the source volume for the replication.
+ :paramtype source_volume_id: str
+ """
+ super(ReestablishReplicationRequest, self).__init__(**kwargs)
+ self.source_volume_id = source_volume_id
+
+
class Replication(msrest.serialization.Model):
"""Replication properties.
All required parameters must be populated in order to send to Azure.
:ivar endpoint_type: Indicates whether the local volume is the source or destination for the
- Volume Replication. Possible values include: "src", "dst".
+ Volume Replication. Known values are: "src", "dst".
:vartype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType
- :ivar replication_schedule: Schedule. Possible values include: "_10minutely", "hourly",
- "daily".
+ :ivar replication_schedule: Schedule. Known values are: "_10minutely", "hourly", "daily".
:vartype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule
:ivar remote_volume_resource_id: Required. The resource ID of the remote volume.
:vartype remote_volume_resource_id: str
@@ -2547,17 +2576,16 @@ def __init__(
self,
*,
remote_volume_resource_id: str,
- endpoint_type: Optional[Union[str, "EndpointType"]] = None,
- replication_schedule: Optional[Union[str, "ReplicationSchedule"]] = None,
+ endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None,
+ replication_schedule: Optional[Union[str, "_models.ReplicationSchedule"]] = None,
remote_volume_region: Optional[str] = None,
**kwargs
):
"""
:keyword endpoint_type: Indicates whether the local volume is the source or destination for the
- Volume Replication. Possible values include: "src", "dst".
+ Volume Replication. Known values are: "src", "dst".
:paramtype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType
- :keyword replication_schedule: Schedule. Possible values include: "_10minutely", "hourly",
- "daily".
+ :keyword replication_schedule: Schedule. Known values are: "_10minutely", "hourly", "daily".
:paramtype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule
:keyword remote_volume_resource_id: Required. The resource ID of the remote volume.
:paramtype remote_volume_resource_id: str
@@ -2579,10 +2607,9 @@ class ReplicationObject(msrest.serialization.Model):
:ivar replication_id: Id.
:vartype replication_id: str
:ivar endpoint_type: Indicates whether the local volume is the source or destination for the
- Volume Replication. Possible values include: "src", "dst".
+ Volume Replication. Known values are: "src", "dst".
:vartype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType
- :ivar replication_schedule: Schedule. Possible values include: "_10minutely", "hourly",
- "daily".
+ :ivar replication_schedule: Schedule. Known values are: "_10minutely", "hourly", "daily".
:vartype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule
:ivar remote_volume_resource_id: Required. The resource ID of the remote volume.
:vartype remote_volume_resource_id: str
@@ -2607,8 +2634,8 @@ def __init__(
*,
remote_volume_resource_id: str,
replication_id: Optional[str] = None,
- endpoint_type: Optional[Union[str, "EndpointType"]] = None,
- replication_schedule: Optional[Union[str, "ReplicationSchedule"]] = None,
+ endpoint_type: Optional[Union[str, "_models.EndpointType"]] = None,
+ replication_schedule: Optional[Union[str, "_models.ReplicationSchedule"]] = None,
remote_volume_region: Optional[str] = None,
**kwargs
):
@@ -2616,10 +2643,9 @@ def __init__(
:keyword replication_id: Id.
:paramtype replication_id: str
:keyword endpoint_type: Indicates whether the local volume is the source or destination for the
- Volume Replication. Possible values include: "src", "dst".
+ Volume Replication. Known values are: "src", "dst".
:paramtype endpoint_type: str or ~azure.mgmt.netapp.models.EndpointType
- :keyword replication_schedule: Schedule. Possible values include: "_10minutely", "hourly",
- "daily".
+ :keyword replication_schedule: Schedule. Known values are: "_10minutely", "hourly", "daily".
:paramtype replication_schedule: str or ~azure.mgmt.netapp.models.ReplicationSchedule
:keyword remote_volume_resource_id: Required. The resource ID of the remote volume.
:paramtype remote_volume_resource_id: str
@@ -2639,10 +2665,10 @@ class ReplicationStatus(msrest.serialization.Model):
:ivar healthy: Replication health check.
:vartype healthy: bool
- :ivar relationship_status: Status of the mirror relationship. Possible values include: "Idle",
+ :ivar relationship_status: Status of the mirror relationship. Known values are: "Idle",
"Transferring".
:vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus
- :ivar mirror_state: The status of the replication. Possible values include: "Uninitialized",
+ :ivar mirror_state: The status of the replication. Known values are: "Uninitialized",
"Mirrored", "Broken".
:vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState
:ivar total_progress: The progress of the replication.
@@ -2663,8 +2689,8 @@ def __init__(
self,
*,
healthy: Optional[bool] = None,
- relationship_status: Optional[Union[str, "RelationshipStatus"]] = None,
- mirror_state: Optional[Union[str, "MirrorState"]] = None,
+ relationship_status: Optional[Union[str, "_models.RelationshipStatus"]] = None,
+ mirror_state: Optional[Union[str, "_models.MirrorState"]] = None,
total_progress: Optional[str] = None,
error_message: Optional[str] = None,
**kwargs
@@ -2672,10 +2698,10 @@ def __init__(
"""
:keyword healthy: Replication health check.
:paramtype healthy: bool
- :keyword relationship_status: Status of the mirror relationship. Possible values include:
- "Idle", "Transferring".
+ :keyword relationship_status: Status of the mirror relationship. Known values are: "Idle",
+ "Transferring".
:paramtype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus
- :keyword mirror_state: The status of the replication. Possible values include: "Uninitialized",
+ :keyword mirror_state: The status of the replication. Known values are: "Uninitialized",
"Mirrored", "Broken".
:paramtype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState
:keyword total_progress: The progress of the replication.
@@ -2738,7 +2764,7 @@ class ResourceNameAvailabilityRequest(msrest.serialization.Model):
:ivar name: Required. Resource name to verify.
:vartype name: str
- :ivar type: Required. Resource type used for verification. Possible values include:
+ :ivar type: Required. Resource type used for verification. Known values are:
"Microsoft.NetApp/netAppAccounts", "Microsoft.NetApp/netAppAccounts/capacityPools",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots".
@@ -2763,14 +2789,14 @@ def __init__(
self,
*,
name: str,
- type: Union[str, "CheckNameResourceTypes"],
+ type: Union[str, "_models.CheckNameResourceTypes"],
resource_group: str,
**kwargs
):
"""
:keyword name: Required. Resource name to verify.
:paramtype name: str
- :keyword type: Required. Resource type used for verification. Possible values include:
+ :keyword type: Required. Resource type used for verification. Known values are:
"Microsoft.NetApp/netAppAccounts", "Microsoft.NetApp/netAppAccounts/capacityPools",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes",
"Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots".
@@ -2791,11 +2817,11 @@ class RestoreStatus(msrest.serialization.Model):
:ivar healthy: Restore health status.
:vartype healthy: bool
- :ivar relationship_status: Status of the restore SnapMirror relationship. Possible values
- include: "Idle", "Transferring".
+ :ivar relationship_status: Status of the restore SnapMirror relationship. Known values are:
+ "Idle", "Transferring".
:vartype relationship_status: str or ~azure.mgmt.netapp.models.RelationshipStatus
- :ivar mirror_state: The status of the restore. Possible values include: "Uninitialized",
- "Mirrored", "Broken".
+ :ivar mirror_state: The status of the restore. Known values are: "Uninitialized", "Mirrored",
+ "Broken".
:vartype mirror_state: str or ~azure.mgmt.netapp.models.MirrorState
:ivar unhealthy_reason: Reason for the unhealthy restore relationship.
:vartype unhealthy_reason: str
@@ -2855,8 +2881,8 @@ class ServiceSpecification(msrest.serialization.Model):
def __init__(
self,
*,
- metric_specifications: Optional[List["MetricSpecification"]] = None,
- log_specifications: Optional[List["LogSpecification"]] = None,
+ metric_specifications: Optional[List["_models.MetricSpecification"]] = None,
+ log_specifications: Optional[List["_models.LogSpecification"]] = None,
**kwargs
):
"""
@@ -2947,7 +2973,7 @@ class SnapshotPoliciesList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["SnapshotPolicy"]] = None,
+ value: Optional[List["_models.SnapshotPolicy"]] = None,
**kwargs
):
"""
@@ -3027,10 +3053,10 @@ def __init__(
*,
location: str,
tags: Optional[Dict[str, str]] = None,
- hourly_schedule: Optional["HourlySchedule"] = None,
- daily_schedule: Optional["DailySchedule"] = None,
- weekly_schedule: Optional["WeeklySchedule"] = None,
- monthly_schedule: Optional["MonthlySchedule"] = None,
+ hourly_schedule: Optional["_models.HourlySchedule"] = None,
+ daily_schedule: Optional["_models.DailySchedule"] = None,
+ weekly_schedule: Optional["_models.WeeklySchedule"] = None,
+ monthly_schedule: Optional["_models.MonthlySchedule"] = None,
enabled: Optional[bool] = None,
**kwargs
):
@@ -3115,10 +3141,10 @@ def __init__(
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
- hourly_schedule: Optional["HourlySchedule"] = None,
- daily_schedule: Optional["DailySchedule"] = None,
- weekly_schedule: Optional["WeeklySchedule"] = None,
- monthly_schedule: Optional["MonthlySchedule"] = None,
+ hourly_schedule: Optional["_models.HourlySchedule"] = None,
+ daily_schedule: Optional["_models.DailySchedule"] = None,
+ weekly_schedule: Optional["_models.WeeklySchedule"] = None,
+ monthly_schedule: Optional["_models.MonthlySchedule"] = None,
enabled: Optional[bool] = None,
**kwargs
):
@@ -3207,10 +3233,10 @@ def __init__(
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
- hourly_schedule: Optional["HourlySchedule"] = None,
- daily_schedule: Optional["DailySchedule"] = None,
- weekly_schedule: Optional["WeeklySchedule"] = None,
- monthly_schedule: Optional["MonthlySchedule"] = None,
+ hourly_schedule: Optional["_models.HourlySchedule"] = None,
+ daily_schedule: Optional["_models.DailySchedule"] = None,
+ weekly_schedule: Optional["_models.WeeklySchedule"] = None,
+ monthly_schedule: Optional["_models.MonthlySchedule"] = None,
enabled: Optional[bool] = None,
**kwargs
):
@@ -3258,7 +3284,7 @@ class SnapshotPolicyVolumeList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Volume"]] = None,
+ value: Optional[List["_models.Volume"]] = None,
**kwargs
):
"""
@@ -3321,7 +3347,7 @@ class SnapshotsList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Snapshot"]] = None,
+ value: Optional[List["_models.Snapshot"]] = None,
**kwargs
):
"""
@@ -3397,7 +3423,7 @@ class SubscriptionQuotaItemList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["SubscriptionQuotaItem"]] = None,
+ value: Optional[List["_models.SubscriptionQuotaItem"]] = None,
**kwargs
):
"""
@@ -3633,7 +3659,7 @@ class SubvolumesList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["SubvolumeInfo"]] = None,
+ value: Optional[List["_models.SubvolumeInfo"]] = None,
next_link: Optional[str] = None,
**kwargs
):
@@ -3653,15 +3679,15 @@ class SystemData(msrest.serialization.Model):
:ivar created_by: The identity that created the resource.
:vartype created_by: str
- :ivar created_by_type: The type of identity that created the resource. Possible values include:
+ :ivar created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", "Key".
:vartype created_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
:ivar created_at: The timestamp of resource creation (UTC).
:vartype created_at: ~datetime.datetime
:ivar last_modified_by: The identity that last modified the resource.
:vartype last_modified_by: str
- :ivar last_modified_by_type: The type of identity that last modified the resource. Possible
- values include: "User", "Application", "ManagedIdentity", "Key".
+ :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
+ are: "User", "Application", "ManagedIdentity", "Key".
:vartype last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
:ivar last_modified_at: The timestamp of resource last modification (UTC).
:vartype last_modified_at: ~datetime.datetime
@@ -3680,25 +3706,25 @@ def __init__(
self,
*,
created_by: Optional[str] = None,
- created_by_type: Optional[Union[str, "CreatedByType"]] = None,
+ created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
created_at: Optional[datetime.datetime] = None,
last_modified_by: Optional[str] = None,
- last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None,
+ last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
last_modified_at: Optional[datetime.datetime] = None,
**kwargs
):
"""
:keyword created_by: The identity that created the resource.
:paramtype created_by: str
- :keyword created_by_type: The type of identity that created the resource. Possible values
- include: "User", "Application", "ManagedIdentity", "Key".
+ :keyword created_by_type: The type of identity that created the resource. Known values are:
+ "User", "Application", "ManagedIdentity", "Key".
:paramtype created_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
:keyword created_at: The timestamp of resource creation (UTC).
:paramtype created_at: ~datetime.datetime
:keyword last_modified_by: The identity that last modified the resource.
:paramtype last_modified_by: str
- :keyword last_modified_by_type: The type of identity that last modified the resource. Possible
- values include: "User", "Application", "ManagedIdentity", "Key".
+ :keyword last_modified_by_type: The type of identity that last modified the resource. Known
+ values are: "User", "Application", "ManagedIdentity", "Key".
:paramtype last_modified_by_type: str or ~azure.mgmt.netapp.models.CreatedByType
:keyword last_modified_at: The timestamp of resource last modification (UTC).
:paramtype last_modified_at: ~datetime.datetime
@@ -3781,7 +3807,7 @@ class VaultList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Vault"]] = None,
+ value: Optional[List["_models.Vault"]] = None,
**kwargs
):
"""
@@ -3823,7 +3849,7 @@ class Volume(TrackedResource):
:ivar creation_token: Required. A unique file path for the volume. Used when creating mount
targets.
:vartype creation_token: str
- :ivar service_level: The service level of the file system. Possible values include: "Standard",
+ :ivar service_level: The service level of the file system. Known values are: "Standard",
"Premium", "Ultra", "StandardZRS". Default value: "Premium".
:vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar usage_threshold: Required. Maximum storage quota allowed for a file system in bytes. This
@@ -3845,14 +3871,14 @@ class Volume(TrackedResource):
:ivar subnet_id: Required. The Azure Resource URI for a delegated subnet. Must have the
delegation Microsoft.NetApp/volumes.
:vartype subnet_id: str
- :ivar network_features: Basic network, or Standard features available to the volume. Possible
- values include: "Basic", "Standard". Default value: "Basic".
+ :ivar network_features: Basic network, or Standard features available to the volume. Known
+ values are: "Basic", "Standard". Default value: "Basic".
:vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures
:ivar network_sibling_set_id: Network Sibling Set ID for the the group of volumes sharing
networking resources.
:vartype network_sibling_set_id: str
:ivar storage_to_network_proximity: Provides storage to network proximity information for the
- volume. Possible values include: "Default", "T1", "T2".
+ volume. Known values are: "Default", "T1", "T2".
:vartype storage_to_network_proximity: str or
~azure.mgmt.netapp.models.VolumeStorageToNetworkProximity
:ivar mount_targets: List of mount targets.
@@ -3872,7 +3898,7 @@ class Volume(TrackedResource):
2020-05-01 or later.
:vartype kerberos_enabled: bool
:ivar security_style: The security style of volume, default unix, defaults to ntfs for dual
- protocol or CIFS protocol. Possible values include: "ntfs", "unix". Default value: "unix".
+ protocol or CIFS protocol. Known values are: "ntfs", "unix". Default value: "unix".
:vartype security_style: str or ~azure.mgmt.netapp.models.SecurityStyle
:ivar smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for
SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later.
@@ -3880,13 +3906,18 @@ class Volume(TrackedResource):
:ivar smb_continuously_available: Enables continuously available share property for smb volume.
Only applicable for SMB volume.
:vartype smb_continuously_available: bool
- :ivar throughput_mibps: Maximum throughput in Mibps that can be achieved by this volume and
+ :ivar throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and
this will be accepted as input only for manual qosType volume.
:vartype throughput_mibps: float
- :ivar encryption_key_source: Source of key used to encrypt data in volume. Possible values
- (case-insensitive) are: 'Microsoft.NetApp'. Possible values include: "Microsoft.NetApp".
- Default value: "Microsoft.NetApp".
+ :ivar encryption_key_source: Source of key used to encrypt data in volume. Applicable if NetApp
+ account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive)
+ are: 'Microsoft.NetApp, Microsoft.KeyVault'. Known values are: "Microsoft.NetApp",
+ "Microsoft.KeyVault". Default value: "Microsoft.NetApp".
:vartype encryption_key_source: str or ~azure.mgmt.netapp.models.EncryptionKeySource
+ :ivar key_vault_private_endpoint_resource_id: The resource ID of private endpoint for KeyVault.
+ It must reside in the same VNET as the volume. Only applicable if encryptionKeySource =
+ 'Microsoft.KeyVault'.
+ :vartype key_vault_private_endpoint_resource_id: str
:ivar ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume.
:vartype ldap_enabled: bool
:ivar cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
@@ -3907,7 +3938,7 @@ class Volume(TrackedResource):
during cloning.
:vartype clone_progress: int
:ivar avs_data_store: Specifies whether the volume is enabled for Azure VMware Solution (AVS)
- datastore purpose. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ datastore purpose. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:vartype avs_data_store: str or ~azure.mgmt.netapp.models.AvsDataStore
:ivar is_default_quota_enabled: Specifies if default quota is enabled for the volume.
:vartype is_default_quota_enabled: bool
@@ -3938,7 +3969,7 @@ class Volume(TrackedResource):
:ivar placement_rules: Application specific placement rules for the particular volume.
:vartype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs]
:ivar enable_subvolumes: Flag indicating whether subvolume operations are enabled on the
- volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ volume. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:vartype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes
"""
@@ -4003,6 +4034,7 @@ class Volume(TrackedResource):
'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'},
'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'},
'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'},
+ 'key_vault_private_endpoint_resource_id': {'key': 'properties.keyVaultPrivateEndpointResourceId', 'type': 'str'},
'ldap_enabled': {'key': 'properties.ldapEnabled', 'type': 'bool'},
'cool_access': {'key': 'properties.coolAccess', 'type': 'bool'},
'coolness_period': {'key': 'properties.coolnessPeriod', 'type': 'int'},
@@ -4032,35 +4064,36 @@ def __init__(
subnet_id: str,
tags: Optional[Dict[str, str]] = None,
zones: Optional[List[str]] = None,
- service_level: Optional[Union[str, "ServiceLevel"]] = "Premium",
- export_policy: Optional["VolumePropertiesExportPolicy"] = None,
+ service_level: Optional[Union[str, "_models.ServiceLevel"]] = "Premium",
+ export_policy: Optional["_models.VolumePropertiesExportPolicy"] = None,
protocol_types: Optional[List[str]] = None,
snapshot_id: Optional[str] = None,
backup_id: Optional[str] = None,
- network_features: Optional[Union[str, "NetworkFeatures"]] = "Basic",
+ network_features: Optional[Union[str, "_models.NetworkFeatures"]] = "Basic",
volume_type: Optional[str] = None,
- data_protection: Optional["VolumePropertiesDataProtection"] = None,
+ data_protection: Optional["_models.VolumePropertiesDataProtection"] = None,
is_restoring: Optional[bool] = None,
snapshot_directory_visible: Optional[bool] = True,
kerberos_enabled: Optional[bool] = False,
- security_style: Optional[Union[str, "SecurityStyle"]] = "unix",
+ security_style: Optional[Union[str, "_models.SecurityStyle"]] = "unix",
smb_encryption: Optional[bool] = False,
smb_continuously_available: Optional[bool] = False,
throughput_mibps: Optional[float] = None,
- encryption_key_source: Optional[Union[str, "EncryptionKeySource"]] = "Microsoft.NetApp",
+ encryption_key_source: Optional[Union[str, "_models.EncryptionKeySource"]] = "Microsoft.NetApp",
+ key_vault_private_endpoint_resource_id: Optional[str] = None,
ldap_enabled: Optional[bool] = False,
cool_access: Optional[bool] = False,
coolness_period: Optional[int] = None,
unix_permissions: Optional[str] = "0770",
- avs_data_store: Optional[Union[str, "AvsDataStore"]] = "Disabled",
+ avs_data_store: Optional[Union[str, "_models.AvsDataStore"]] = "Disabled",
is_default_quota_enabled: Optional[bool] = False,
default_user_quota_in_ki_bs: Optional[int] = 0,
default_group_quota_in_ki_bs: Optional[int] = 0,
capacity_pool_resource_id: Optional[str] = None,
proximity_placement_group: Optional[str] = None,
volume_spec_name: Optional[str] = None,
- placement_rules: Optional[List["PlacementKeyValuePairs"]] = None,
- enable_subvolumes: Optional[Union[str, "EnableSubvolumes"]] = "Disabled",
+ placement_rules: Optional[List["_models.PlacementKeyValuePairs"]] = None,
+ enable_subvolumes: Optional[Union[str, "_models.EnableSubvolumes"]] = "Disabled",
**kwargs
):
"""
@@ -4073,8 +4106,8 @@ def __init__(
:keyword creation_token: Required. A unique file path for the volume. Used when creating mount
targets.
:paramtype creation_token: str
- :keyword service_level: The service level of the file system. Possible values include:
- "Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
+ :keyword service_level: The service level of the file system. Known values are: "Standard",
+ "Premium", "Ultra", "StandardZRS". Default value: "Premium".
:paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:keyword usage_threshold: Required. Maximum storage quota allowed for a file system in bytes.
This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB.
@@ -4091,8 +4124,8 @@ def __init__(
:keyword subnet_id: Required. The Azure Resource URI for a delegated subnet. Must have the
delegation Microsoft.NetApp/volumes.
:paramtype subnet_id: str
- :keyword network_features: Basic network, or Standard features available to the volume.
- Possible values include: "Basic", "Standard". Default value: "Basic".
+ :keyword network_features: Basic network, or Standard features available to the volume. Known
+ values are: "Basic", "Standard". Default value: "Basic".
:paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures
:keyword volume_type: What type of volume is this. For destination volumes in Cross Region
Replication, set type to DataProtection.
@@ -4109,7 +4142,7 @@ def __init__(
version 2020-05-01 or later.
:paramtype kerberos_enabled: bool
:keyword security_style: The security style of volume, default unix, defaults to ntfs for dual
- protocol or CIFS protocol. Possible values include: "ntfs", "unix". Default value: "unix".
+ protocol or CIFS protocol. Known values are: "ntfs", "unix". Default value: "unix".
:paramtype security_style: str or ~azure.mgmt.netapp.models.SecurityStyle
:keyword smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for
SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later.
@@ -4117,13 +4150,18 @@ def __init__(
:keyword smb_continuously_available: Enables continuously available share property for smb
volume. Only applicable for SMB volume.
:paramtype smb_continuously_available: bool
- :keyword throughput_mibps: Maximum throughput in Mibps that can be achieved by this volume and
+ :keyword throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and
this will be accepted as input only for manual qosType volume.
:paramtype throughput_mibps: float
- :keyword encryption_key_source: Source of key used to encrypt data in volume. Possible values
- (case-insensitive) are: 'Microsoft.NetApp'. Possible values include: "Microsoft.NetApp".
- Default value: "Microsoft.NetApp".
+ :keyword encryption_key_source: Source of key used to encrypt data in volume. Applicable if
+ NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values
+ (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. Known values are:
+ "Microsoft.NetApp", "Microsoft.KeyVault". Default value: "Microsoft.NetApp".
:paramtype encryption_key_source: str or ~azure.mgmt.netapp.models.EncryptionKeySource
+ :keyword key_vault_private_endpoint_resource_id: The resource ID of private endpoint for
+ KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource
+ = 'Microsoft.KeyVault'.
+ :paramtype key_vault_private_endpoint_resource_id: str
:keyword ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume.
:paramtype ldap_enabled: bool
:keyword cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
@@ -4139,8 +4177,7 @@ def __init__(
users.
:paramtype unix_permissions: str
:keyword avs_data_store: Specifies whether the volume is enabled for Azure VMware Solution
- (AVS) datastore purpose. Possible values include: "Enabled", "Disabled". Default value:
- "Disabled".
+ (AVS) datastore purpose. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:paramtype avs_data_store: str or ~azure.mgmt.netapp.models.AvsDataStore
:keyword is_default_quota_enabled: Specifies if default quota is enabled for the volume.
:paramtype is_default_quota_enabled: bool
@@ -4161,7 +4198,7 @@ def __init__(
:keyword placement_rules: Application specific placement rules for the particular volume.
:paramtype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs]
:keyword enable_subvolumes: Flag indicating whether subvolume operations are enabled on the
- volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ volume. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes
"""
super(Volume, self).__init__(tags=tags, location=location, **kwargs)
@@ -4192,6 +4229,7 @@ def __init__(
self.smb_continuously_available = smb_continuously_available
self.throughput_mibps = throughput_mibps
self.encryption_key_source = encryption_key_source
+ self.key_vault_private_endpoint_resource_id = key_vault_private_endpoint_resource_id
self.ldap_enabled = ldap_enabled
self.cool_access = cool_access
self.coolness_period = coolness_period
@@ -4336,7 +4374,7 @@ def __init__(
self,
*,
location: Optional[str] = None,
- group_meta_data: Optional["VolumeGroupMetaData"] = None,
+ group_meta_data: Optional["_models.VolumeGroupMetaData"] = None,
**kwargs
):
"""
@@ -4396,8 +4434,8 @@ def __init__(
self,
*,
location: Optional[str] = None,
- group_meta_data: Optional["VolumeGroupMetaData"] = None,
- volumes: Optional[List["VolumeGroupVolumeProperties"]] = None,
+ group_meta_data: Optional["_models.VolumeGroupMetaData"] = None,
+ volumes: Optional[List["_models.VolumeGroupVolumeProperties"]] = None,
**kwargs
):
"""
@@ -4432,7 +4470,7 @@ class VolumeGroupList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["VolumeGroup"]] = None,
+ value: Optional[List["_models.VolumeGroup"]] = None,
**kwargs
):
"""
@@ -4450,7 +4488,7 @@ class VolumeGroupMetaData(msrest.serialization.Model):
:ivar group_description: Group Description.
:vartype group_description: str
- :ivar application_type: Application Type. Possible values include: "SAP-HANA".
+ :ivar application_type: Application Type. Known values are: "SAP-HANA".
:vartype application_type: str or ~azure.mgmt.netapp.models.ApplicationType
:ivar application_identifier: Application specific identifier.
:vartype application_identifier: str
@@ -4480,16 +4518,16 @@ def __init__(
self,
*,
group_description: Optional[str] = None,
- application_type: Optional[Union[str, "ApplicationType"]] = None,
+ application_type: Optional[Union[str, "_models.ApplicationType"]] = None,
application_identifier: Optional[str] = None,
- global_placement_rules: Optional[List["PlacementKeyValuePairs"]] = None,
+ global_placement_rules: Optional[List["_models.PlacementKeyValuePairs"]] = None,
deployment_spec_id: Optional[str] = None,
**kwargs
):
"""
:keyword group_description: Group Description.
:paramtype group_description: str
- :keyword application_type: Application Type. Possible values include: "SAP-HANA".
+ :keyword application_type: Application Type. Known values are: "SAP-HANA".
:paramtype application_type: str or ~azure.mgmt.netapp.models.ApplicationType
:keyword application_identifier: Application specific identifier.
:paramtype application_identifier: str
@@ -4528,7 +4566,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
:ivar creation_token: Required. A unique file path for the volume. Used when creating mount
targets.
:vartype creation_token: str
- :ivar service_level: The service level of the file system. Possible values include: "Standard",
+ :ivar service_level: The service level of the file system. Known values are: "Standard",
"Premium", "Ultra", "StandardZRS". Default value: "Premium".
:vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar usage_threshold: Required. Maximum storage quota allowed for a file system in bytes. This
@@ -4550,14 +4588,14 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
:ivar subnet_id: Required. The Azure Resource URI for a delegated subnet. Must have the
delegation Microsoft.NetApp/volumes.
:vartype subnet_id: str
- :ivar network_features: Basic network, or Standard features available to the volume. Possible
- values include: "Basic", "Standard". Default value: "Basic".
+ :ivar network_features: Basic network, or Standard features available to the volume. Known
+ values are: "Basic", "Standard". Default value: "Basic".
:vartype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures
:ivar network_sibling_set_id: Network Sibling Set ID for the the group of volumes sharing
networking resources.
:vartype network_sibling_set_id: str
:ivar storage_to_network_proximity: Provides storage to network proximity information for the
- volume. Possible values include: "Default", "T1", "T2".
+ volume. Known values are: "Default", "T1", "T2".
:vartype storage_to_network_proximity: str or
~azure.mgmt.netapp.models.VolumeStorageToNetworkProximity
:ivar mount_targets: List of mount targets.
@@ -4577,7 +4615,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
2020-05-01 or later.
:vartype kerberos_enabled: bool
:ivar security_style: The security style of volume, default unix, defaults to ntfs for dual
- protocol or CIFS protocol. Possible values include: "ntfs", "unix". Default value: "unix".
+ protocol or CIFS protocol. Known values are: "ntfs", "unix". Default value: "unix".
:vartype security_style: str or ~azure.mgmt.netapp.models.SecurityStyle
:ivar smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for
SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later.
@@ -4585,13 +4623,18 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
:ivar smb_continuously_available: Enables continuously available share property for smb volume.
Only applicable for SMB volume.
:vartype smb_continuously_available: bool
- :ivar throughput_mibps: Maximum throughput in Mibps that can be achieved by this volume and
+ :ivar throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and
this will be accepted as input only for manual qosType volume.
:vartype throughput_mibps: float
- :ivar encryption_key_source: Source of key used to encrypt data in volume. Possible values
- (case-insensitive) are: 'Microsoft.NetApp'. Possible values include: "Microsoft.NetApp".
- Default value: "Microsoft.NetApp".
+ :ivar encryption_key_source: Source of key used to encrypt data in volume. Applicable if NetApp
+ account has encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive)
+ are: 'Microsoft.NetApp, Microsoft.KeyVault'. Known values are: "Microsoft.NetApp",
+ "Microsoft.KeyVault". Default value: "Microsoft.NetApp".
:vartype encryption_key_source: str or ~azure.mgmt.netapp.models.EncryptionKeySource
+ :ivar key_vault_private_endpoint_resource_id: The resource ID of private endpoint for KeyVault.
+ It must reside in the same VNET as the volume. Only applicable if encryptionKeySource =
+ 'Microsoft.KeyVault'.
+ :vartype key_vault_private_endpoint_resource_id: str
:ivar ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume.
:vartype ldap_enabled: bool
:ivar cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
@@ -4612,7 +4655,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
during cloning.
:vartype clone_progress: int
:ivar avs_data_store: Specifies whether the volume is enabled for Azure VMware Solution (AVS)
- datastore purpose. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ datastore purpose. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:vartype avs_data_store: str or ~azure.mgmt.netapp.models.AvsDataStore
:ivar is_default_quota_enabled: Specifies if default quota is enabled for the volume.
:vartype is_default_quota_enabled: bool
@@ -4643,7 +4686,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
:ivar placement_rules: Application specific placement rules for the particular volume.
:vartype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs]
:ivar enable_subvolumes: Flag indicating whether subvolume operations are enabled on the
- volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ volume. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:vartype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes
"""
@@ -4700,6 +4743,7 @@ class VolumeGroupVolumeProperties(msrest.serialization.Model):
'smb_continuously_available': {'key': 'properties.smbContinuouslyAvailable', 'type': 'bool'},
'throughput_mibps': {'key': 'properties.throughputMibps', 'type': 'float'},
'encryption_key_source': {'key': 'properties.encryptionKeySource', 'type': 'str'},
+ 'key_vault_private_endpoint_resource_id': {'key': 'properties.keyVaultPrivateEndpointResourceId', 'type': 'str'},
'ldap_enabled': {'key': 'properties.ldapEnabled', 'type': 'bool'},
'cool_access': {'key': 'properties.coolAccess', 'type': 'bool'},
'coolness_period': {'key': 'properties.coolnessPeriod', 'type': 'int'},
@@ -4728,35 +4772,36 @@ def __init__(
subnet_id: str,
name: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
- service_level: Optional[Union[str, "ServiceLevel"]] = "Premium",
- export_policy: Optional["VolumePropertiesExportPolicy"] = None,
+ service_level: Optional[Union[str, "_models.ServiceLevel"]] = "Premium",
+ export_policy: Optional["_models.VolumePropertiesExportPolicy"] = None,
protocol_types: Optional[List[str]] = None,
snapshot_id: Optional[str] = None,
backup_id: Optional[str] = None,
- network_features: Optional[Union[str, "NetworkFeatures"]] = "Basic",
+ network_features: Optional[Union[str, "_models.NetworkFeatures"]] = "Basic",
volume_type: Optional[str] = None,
- data_protection: Optional["VolumePropertiesDataProtection"] = None,
+ data_protection: Optional["_models.VolumePropertiesDataProtection"] = None,
is_restoring: Optional[bool] = None,
snapshot_directory_visible: Optional[bool] = True,
kerberos_enabled: Optional[bool] = False,
- security_style: Optional[Union[str, "SecurityStyle"]] = "unix",
+ security_style: Optional[Union[str, "_models.SecurityStyle"]] = "unix",
smb_encryption: Optional[bool] = False,
smb_continuously_available: Optional[bool] = False,
throughput_mibps: Optional[float] = None,
- encryption_key_source: Optional[Union[str, "EncryptionKeySource"]] = "Microsoft.NetApp",
+ encryption_key_source: Optional[Union[str, "_models.EncryptionKeySource"]] = "Microsoft.NetApp",
+ key_vault_private_endpoint_resource_id: Optional[str] = None,
ldap_enabled: Optional[bool] = False,
cool_access: Optional[bool] = False,
coolness_period: Optional[int] = None,
unix_permissions: Optional[str] = "0770",
- avs_data_store: Optional[Union[str, "AvsDataStore"]] = "Disabled",
+ avs_data_store: Optional[Union[str, "_models.AvsDataStore"]] = "Disabled",
is_default_quota_enabled: Optional[bool] = False,
default_user_quota_in_ki_bs: Optional[int] = 0,
default_group_quota_in_ki_bs: Optional[int] = 0,
capacity_pool_resource_id: Optional[str] = None,
proximity_placement_group: Optional[str] = None,
volume_spec_name: Optional[str] = None,
- placement_rules: Optional[List["PlacementKeyValuePairs"]] = None,
- enable_subvolumes: Optional[Union[str, "EnableSubvolumes"]] = "Disabled",
+ placement_rules: Optional[List["_models.PlacementKeyValuePairs"]] = None,
+ enable_subvolumes: Optional[Union[str, "_models.EnableSubvolumes"]] = "Disabled",
**kwargs
):
"""
@@ -4767,8 +4812,8 @@ def __init__(
:keyword creation_token: Required. A unique file path for the volume. Used when creating mount
targets.
:paramtype creation_token: str
- :keyword service_level: The service level of the file system. Possible values include:
- "Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
+ :keyword service_level: The service level of the file system. Known values are: "Standard",
+ "Premium", "Ultra", "StandardZRS". Default value: "Premium".
:paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:keyword usage_threshold: Required. Maximum storage quota allowed for a file system in bytes.
This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB.
@@ -4785,8 +4830,8 @@ def __init__(
:keyword subnet_id: Required. The Azure Resource URI for a delegated subnet. Must have the
delegation Microsoft.NetApp/volumes.
:paramtype subnet_id: str
- :keyword network_features: Basic network, or Standard features available to the volume.
- Possible values include: "Basic", "Standard". Default value: "Basic".
+ :keyword network_features: Basic network, or Standard features available to the volume. Known
+ values are: "Basic", "Standard". Default value: "Basic".
:paramtype network_features: str or ~azure.mgmt.netapp.models.NetworkFeatures
:keyword volume_type: What type of volume is this. For destination volumes in Cross Region
Replication, set type to DataProtection.
@@ -4803,7 +4848,7 @@ def __init__(
version 2020-05-01 or later.
:paramtype kerberos_enabled: bool
:keyword security_style: The security style of volume, default unix, defaults to ntfs for dual
- protocol or CIFS protocol. Possible values include: "ntfs", "unix". Default value: "unix".
+ protocol or CIFS protocol. Known values are: "ntfs", "unix". Default value: "unix".
:paramtype security_style: str or ~azure.mgmt.netapp.models.SecurityStyle
:keyword smb_encryption: Enables encryption for in-flight smb3 data. Only applicable for
SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later.
@@ -4811,13 +4856,18 @@ def __init__(
:keyword smb_continuously_available: Enables continuously available share property for smb
volume. Only applicable for SMB volume.
:paramtype smb_continuously_available: bool
- :keyword throughput_mibps: Maximum throughput in Mibps that can be achieved by this volume and
+ :keyword throughput_mibps: Maximum throughput in MiB/s that can be achieved by this volume and
this will be accepted as input only for manual qosType volume.
:paramtype throughput_mibps: float
- :keyword encryption_key_source: Source of key used to encrypt data in volume. Possible values
- (case-insensitive) are: 'Microsoft.NetApp'. Possible values include: "Microsoft.NetApp".
- Default value: "Microsoft.NetApp".
+ :keyword encryption_key_source: Source of key used to encrypt data in volume. Applicable if
+ NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible values
+ (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. Known values are:
+ "Microsoft.NetApp", "Microsoft.KeyVault". Default value: "Microsoft.NetApp".
:paramtype encryption_key_source: str or ~azure.mgmt.netapp.models.EncryptionKeySource
+ :keyword key_vault_private_endpoint_resource_id: The resource ID of private endpoint for
+ KeyVault. It must reside in the same VNET as the volume. Only applicable if encryptionKeySource
+ = 'Microsoft.KeyVault'.
+ :paramtype key_vault_private_endpoint_resource_id: str
:keyword ldap_enabled: Specifies whether LDAP is enabled or not for a given NFS volume.
:paramtype ldap_enabled: bool
:keyword cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
@@ -4833,8 +4883,7 @@ def __init__(
users.
:paramtype unix_permissions: str
:keyword avs_data_store: Specifies whether the volume is enabled for Azure VMware Solution
- (AVS) datastore purpose. Possible values include: "Enabled", "Disabled". Default value:
- "Disabled".
+ (AVS) datastore purpose. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:paramtype avs_data_store: str or ~azure.mgmt.netapp.models.AvsDataStore
:keyword is_default_quota_enabled: Specifies if default quota is enabled for the volume.
:paramtype is_default_quota_enabled: bool
@@ -4855,7 +4904,7 @@ def __init__(
:keyword placement_rules: Application specific placement rules for the particular volume.
:paramtype placement_rules: list[~azure.mgmt.netapp.models.PlacementKeyValuePairs]
:keyword enable_subvolumes: Flag indicating whether subvolume operations are enabled on the
- volume. Possible values include: "Enabled", "Disabled". Default value: "Disabled".
+ volume. Known values are: "Enabled", "Disabled". Default value: "Disabled".
:paramtype enable_subvolumes: str or ~azure.mgmt.netapp.models.EnableSubvolumes
"""
super(VolumeGroupVolumeProperties, self).__init__(**kwargs)
@@ -4888,6 +4937,7 @@ def __init__(
self.smb_continuously_available = smb_continuously_available
self.throughput_mibps = throughput_mibps
self.encryption_key_source = encryption_key_source
+ self.key_vault_private_endpoint_resource_id = key_vault_private_endpoint_resource_id
self.ldap_enabled = ldap_enabled
self.cool_access = cool_access
self.coolness_period = coolness_period
@@ -4925,7 +4975,7 @@ class VolumeList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["Volume"]] = None,
+ value: Optional[List["_models.Volume"]] = None,
next_link: Optional[str] = None,
**kwargs
):
@@ -4955,7 +5005,7 @@ class VolumePatch(msrest.serialization.Model):
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
- :ivar service_level: The service level of the file system. Possible values include: "Standard",
+ :ivar service_level: The service level of the file system. Known values are: "Standard",
"Premium", "Ultra", "StandardZRS". Default value: "Premium".
:vartype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:ivar usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a soft
@@ -4985,6 +5035,11 @@ class VolumePatch(msrest.serialization.Model):
group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other
users.
:vartype unix_permissions: str
+ :ivar cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
+ :vartype cool_access: bool
+ :ivar coolness_period: Specifies the number of days after which data that is not accessed by
+ clients will be tiered.
+ :vartype coolness_period: int
"""
_validation = {
@@ -4993,6 +5048,7 @@ class VolumePatch(msrest.serialization.Model):
'type': {'readonly': True},
'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400},
'unix_permissions': {'max_length': 4, 'min_length': 4},
+ 'coolness_period': {'maximum': 63, 'minimum': 7},
}
_attribute_map = {
@@ -5010,6 +5066,8 @@ class VolumePatch(msrest.serialization.Model):
'default_user_quota_in_ki_bs': {'key': 'properties.defaultUserQuotaInKiBs', 'type': 'long'},
'default_group_quota_in_ki_bs': {'key': 'properties.defaultGroupQuotaInKiBs', 'type': 'long'},
'unix_permissions': {'key': 'properties.unixPermissions', 'type': 'str'},
+ 'cool_access': {'key': 'properties.coolAccess', 'type': 'bool'},
+ 'coolness_period': {'key': 'properties.coolnessPeriod', 'type': 'int'},
}
def __init__(
@@ -5017,15 +5075,17 @@ def __init__(
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
- service_level: Optional[Union[str, "ServiceLevel"]] = "Premium",
+ service_level: Optional[Union[str, "_models.ServiceLevel"]] = "Premium",
usage_threshold: Optional[int] = 107374182400,
- export_policy: Optional["VolumePatchPropertiesExportPolicy"] = None,
+ export_policy: Optional["_models.VolumePatchPropertiesExportPolicy"] = None,
throughput_mibps: Optional[float] = None,
- data_protection: Optional["VolumePatchPropertiesDataProtection"] = None,
+ data_protection: Optional["_models.VolumePatchPropertiesDataProtection"] = None,
is_default_quota_enabled: Optional[bool] = False,
default_user_quota_in_ki_bs: Optional[int] = 0,
default_group_quota_in_ki_bs: Optional[int] = 0,
unix_permissions: Optional[str] = None,
+ cool_access: Optional[bool] = None,
+ coolness_period: Optional[int] = None,
**kwargs
):
"""
@@ -5033,8 +5093,8 @@ def __init__(
:paramtype location: str
:keyword tags: A set of tags. Resource tags.
:paramtype tags: dict[str, str]
- :keyword service_level: The service level of the file system. Possible values include:
- "Standard", "Premium", "Ultra", "StandardZRS". Default value: "Premium".
+ :keyword service_level: The service level of the file system. Known values are: "Standard",
+ "Premium", "Ultra", "StandardZRS". Default value: "Premium".
:paramtype service_level: str or ~azure.mgmt.netapp.models.ServiceLevel
:keyword usage_threshold: Maximum storage quota allowed for a file system in bytes. This is a
soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in
@@ -5063,6 +5123,11 @@ def __init__(
group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other
users.
:paramtype unix_permissions: str
+ :keyword cool_access: Specifies whether Cool Access(tiering) is enabled for the volume.
+ :paramtype cool_access: bool
+ :keyword coolness_period: Specifies the number of days after which data that is not accessed by
+ clients will be tiered.
+ :paramtype coolness_period: int
"""
super(VolumePatch, self).__init__(**kwargs)
self.location = location
@@ -5079,6 +5144,8 @@ def __init__(
self.default_user_quota_in_ki_bs = default_user_quota_in_ki_bs
self.default_group_quota_in_ki_bs = default_group_quota_in_ki_bs
self.unix_permissions = unix_permissions
+ self.cool_access = cool_access
+ self.coolness_period = coolness_period
class VolumePatchPropertiesDataProtection(msrest.serialization.Model):
@@ -5098,8 +5165,8 @@ class VolumePatchPropertiesDataProtection(msrest.serialization.Model):
def __init__(
self,
*,
- backup: Optional["VolumeBackupProperties"] = None,
- snapshot: Optional["VolumeSnapshotProperties"] = None,
+ backup: Optional["_models.VolumeBackupProperties"] = None,
+ snapshot: Optional["_models.VolumeSnapshotProperties"] = None,
**kwargs
):
"""
@@ -5127,7 +5194,7 @@ class VolumePatchPropertiesExportPolicy(msrest.serialization.Model):
def __init__(
self,
*,
- rules: Optional[List["ExportPolicyRule"]] = None,
+ rules: Optional[List["_models.ExportPolicyRule"]] = None,
**kwargs
):
"""
@@ -5158,9 +5225,9 @@ class VolumePropertiesDataProtection(msrest.serialization.Model):
def __init__(
self,
*,
- backup: Optional["VolumeBackupProperties"] = None,
- replication: Optional["ReplicationObject"] = None,
- snapshot: Optional["VolumeSnapshotProperties"] = None,
+ backup: Optional["_models.VolumeBackupProperties"] = None,
+ replication: Optional["_models.ReplicationObject"] = None,
+ snapshot: Optional["_models.VolumeSnapshotProperties"] = None,
**kwargs
):
"""
@@ -5191,7 +5258,7 @@ class VolumePropertiesExportPolicy(msrest.serialization.Model):
def __init__(
self,
*,
- rules: Optional[List["ExportPolicyRule"]] = None,
+ rules: Optional[List["_models.ExportPolicyRule"]] = None,
**kwargs
):
"""
@@ -5225,13 +5292,13 @@ class VolumeQuotaRule(TrackedResource):
:ivar location: Required. The geo-location where the resource lives.
:vartype location: str
:ivar provisioning_state: Gets the status of the VolumeQuotaRule at the time the operation was
- called. Possible values include: "Accepted", "Creating", "Patching", "Deleting", "Moving",
- "Failed", "Succeeded".
+ called. Known values are: "Accepted", "Creating", "Patching", "Deleting", "Moving", "Failed",
+ "Succeeded".
:vartype provisioning_state: str or ~azure.mgmt.netapp.models.ProvisioningState
:ivar quota_size_in_ki_bs: Size of quota.
:vartype quota_size_in_ki_bs: long
- :ivar quota_type: Type of quota. Possible values include: "DefaultUserQuota",
- "DefaultGroupQuota", "IndividualUserQuota", "IndividualGroupQuota".
+ :ivar quota_type: Type of quota. Known values are: "DefaultUserQuota", "DefaultGroupQuota",
+ "IndividualUserQuota", "IndividualGroupQuota".
:vartype quota_type: str or ~azure.mgmt.netapp.models.Type
:ivar quota_target: UserID/GroupID/SID based on the quota target type. UserID and groupID can
be found by running ‘id’ or ‘getent’ command for the user or group and SID can be found by
@@ -5267,7 +5334,7 @@ def __init__(
location: str,
tags: Optional[Dict[str, str]] = None,
quota_size_in_ki_bs: Optional[int] = None,
- quota_type: Optional[Union[str, "Type"]] = None,
+ quota_type: Optional[Union[str, "_models.Type"]] = None,
quota_target: Optional[str] = None,
**kwargs
):
@@ -5278,8 +5345,8 @@ def __init__(
:paramtype location: str
:keyword quota_size_in_ki_bs: Size of quota.
:paramtype quota_size_in_ki_bs: long
- :keyword quota_type: Type of quota. Possible values include: "DefaultUserQuota",
- "DefaultGroupQuota", "IndividualUserQuota", "IndividualGroupQuota".
+ :keyword quota_type: Type of quota. Known values are: "DefaultUserQuota", "DefaultGroupQuota",
+ "IndividualUserQuota", "IndividualGroupQuota".
:paramtype quota_type: str or ~azure.mgmt.netapp.models.Type
:keyword quota_target: UserID/GroupID/SID based on the quota target type. UserID and groupID
can be found by running ‘id’ or ‘getent’ command for the user or group and SID can be found by
@@ -5299,13 +5366,13 @@ class VolumeQuotaRulePatch(msrest.serialization.Model):
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: Gets the status of the VolumeQuotaRule at the time the operation was
- called. Possible values include: "Accepted", "Creating", "Patching", "Deleting", "Moving",
- "Failed", "Succeeded".
+ called. Known values are: "Accepted", "Creating", "Patching", "Deleting", "Moving", "Failed",
+ "Succeeded".
:vartype provisioning_state: str or ~azure.mgmt.netapp.models.ProvisioningState
:ivar quota_size_in_ki_bs: Size of quota.
:vartype quota_size_in_ki_bs: long
- :ivar quota_type: Type of quota. Possible values include: "DefaultUserQuota",
- "DefaultGroupQuota", "IndividualUserQuota", "IndividualGroupQuota".
+ :ivar quota_type: Type of quota. Known values are: "DefaultUserQuota", "DefaultGroupQuota",
+ "IndividualUserQuota", "IndividualGroupQuota".
:vartype quota_type: str or ~azure.mgmt.netapp.models.Type
:ivar quota_target: UserID/GroupID/SID based on the quota target type. UserID and groupID can
be found by running ‘id’ or ‘getent’ command for the user or group and SID can be found by
@@ -5328,15 +5395,15 @@ def __init__(
self,
*,
quota_size_in_ki_bs: Optional[int] = None,
- quota_type: Optional[Union[str, "Type"]] = None,
+ quota_type: Optional[Union[str, "_models.Type"]] = None,
quota_target: Optional[str] = None,
**kwargs
):
"""
:keyword quota_size_in_ki_bs: Size of quota.
:paramtype quota_size_in_ki_bs: long
- :keyword quota_type: Type of quota. Possible values include: "DefaultUserQuota",
- "DefaultGroupQuota", "IndividualUserQuota", "IndividualGroupQuota".
+ :keyword quota_type: Type of quota. Known values are: "DefaultUserQuota", "DefaultGroupQuota",
+ "IndividualUserQuota", "IndividualGroupQuota".
:paramtype quota_type: str or ~azure.mgmt.netapp.models.Type
:keyword quota_target: UserID/GroupID/SID based on the quota target type. UserID and groupID
can be found by running ‘id’ or ‘getent’ command for the user or group and SID can be found by
@@ -5364,7 +5431,7 @@ class VolumeQuotaRulesList(msrest.serialization.Model):
def __init__(
self,
*,
- value: Optional[List["VolumeQuotaRule"]] = None,
+ value: Optional[List["_models.VolumeQuotaRule"]] = None,
**kwargs
):
"""
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py
index ac510002f50ac..8ab188dd87bd7 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_net_app_management_client_enums.py
@@ -7,11 +7,10 @@
# --------------------------------------------------------------------------
from enum import Enum
-from six import with_metaclass
from azure.core import CaseInsensitiveEnumMeta
-class ActiveDirectoryStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ActiveDirectoryStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Status of the Active Directory
"""
@@ -26,13 +25,13 @@ class ActiveDirectoryStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: Active Directory Updating.
UPDATING = "Updating"
-class ApplicationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ApplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Application Type
"""
SAP_HANA = "SAP-HANA"
-class AvsDataStore(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class AvsDataStore(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose
"""
@@ -41,7 +40,7 @@ class AvsDataStore(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: avsDataStore is disabled.
DISABLED = "Disabled"
-class BackupType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class BackupType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Type of backup Manual or Scheduled
"""
@@ -50,7 +49,7 @@ class BackupType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: Scheduled backup.
SCHEDULED = "Scheduled"
-class CheckNameResourceTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class CheckNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Resource type used for verification.
"""
@@ -59,7 +58,7 @@ class CheckNameResourceTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum))
MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
-class CheckQuotaNameResourceTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class CheckQuotaNameResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Resource type used for verification.
"""
@@ -68,7 +67,7 @@ class CheckQuotaNameResourceTypes(with_metaclass(CaseInsensitiveEnumMeta, str, E
MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
-class ChownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ChownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""This parameter specifies who is authorized to change the ownership of a file. restricted - Only
root user can change the ownership of the file. unrestricted - Non-root users can change
ownership of files that they own.
@@ -77,7 +76,7 @@ class ChownMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
RESTRICTED = "Restricted"
UNRESTRICTED = "Unrestricted"
-class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of identity that created the resource.
"""
@@ -86,7 +85,7 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
MANAGED_IDENTITY = "ManagedIdentity"
KEY = "Key"
-class EnableSubvolumes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class EnableSubvolumes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Flag indicating whether subvolume operations are enabled on the volume
"""
@@ -95,15 +94,18 @@ class EnableSubvolumes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: subvolumes are not enabled.
DISABLED = "Disabled"
-class EncryptionKeySource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
- """Source of key used to encrypt data in volume. Possible values (case-insensitive) are:
- 'Microsoft.NetApp'
+class EncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Source of key used to encrypt data in volume. Applicable if NetApp account has
+ encryption.keySource = 'Microsoft.KeyVault'. Possible values (case-insensitive) are:
+ 'Microsoft.NetApp, Microsoft.KeyVault'
"""
#: Microsoft-managed key encryption.
MICROSOFT_NET_APP = "Microsoft.NetApp"
+ #: Customer-managed key encryption.
+ MICROSOFT_KEY_VAULT = "Microsoft.KeyVault"
-class EncryptionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class EncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Encryption type of the capacity pool, set encryption type for data at rest for this pool and
all volumes in it. This value can only be set when creating new pool.
"""
@@ -113,14 +115,14 @@ class EncryptionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: EncryptionType Double, volumes will use double encryption at rest.
DOUBLE = "Double"
-class EndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Indicates whether the local volume is the source or destination for the Volume Replication
"""
SRC = "src"
DST = "dst"
-class InAvailabilityReasonType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class InAvailabilityReasonType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
""":code:`Invalid
` indicates the name provided does not match Azure App Service
naming requirements. :code:`AlreadyExists
` indicates that the name is already in
use and is therefore unavailable.
@@ -129,11 +131,11 @@ class InAvailabilityReasonType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum
INVALID = "Invalid"
ALREADY_EXISTS = "AlreadyExists"
-class MetricAggregationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class MetricAggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AVERAGE = "Average"
-class MirrorState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class MirrorState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the replication
"""
@@ -141,7 +143,7 @@ class MirrorState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
MIRRORED = "Mirrored"
BROKEN = "Broken"
-class NetworkFeatures(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class NetworkFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Basic network, or Standard features available to the volume.
"""
@@ -150,7 +152,7 @@ class NetworkFeatures(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: Standard network feature.
STANDARD = "Standard"
-class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the status of the VolumeQuotaRule at the time the operation was called.
"""
@@ -162,7 +164,7 @@ class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
FAILED = "Failed"
SUCCEEDED = "Succeeded"
-class QosType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class QosType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The qos type of the pool
"""
@@ -171,14 +173,14 @@ class QosType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: qos type Manual.
MANUAL = "Manual"
-class RelationshipStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class RelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Status of the mirror relationship
"""
IDLE = "Idle"
TRANSFERRING = "Transferring"
-class ReplicationSchedule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ReplicationSchedule(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Schedule
"""
@@ -186,14 +188,14 @@ class ReplicationSchedule(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
HOURLY = "hourly"
DAILY = "daily"
-class SecurityStyle(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class SecurityStyle(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol
"""
NTFS = "ntfs"
UNIX = "unix"
-class ServiceLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class ServiceLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The service level of the file system
"""
@@ -206,7 +208,7 @@ class ServiceLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: Zone redundant storage service level.
STANDARD_ZRS = "StandardZRS"
-class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Type of quota
"""
@@ -219,7 +221,7 @@ class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
#: Individual group quota.
INDIVIDUAL_GROUP_QUOTA = "IndividualGroupQuota"
-class VolumeStorageToNetworkProximity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
+class VolumeStorageToNetworkProximity(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Provides storage to network proximity information for the volume.
"""
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_patch.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_patch.py
new file mode 100644
index 0000000000000..0ad201a8c586e
--- /dev/null
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/models/_patch.py
@@ -0,0 +1,19 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py
index 7b804194eeb54..86c8adf317b2f 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/__init__.py
@@ -22,6 +22,9 @@
from ._volume_groups_operations import VolumeGroupsOperations
from ._subvolumes_operations import SubvolumesOperations
+from ._patch import __all__ as _patch_all
+from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
+from ._patch import patch_sdk as _patch_sdk
__all__ = [
'Operations',
'NetAppResourceOperations',
@@ -39,3 +42,5 @@
'VolumeGroupsOperations',
'SubvolumesOperations',
]
+__all__.extend([p for p in _patch_all if p not in __all__])
+_patch_sdk()
\ No newline at end of file
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py
index 34b640f65fca2..a015313f6622d 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_account_backups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,6 +17,7 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
@@ -34,9 +35,12 @@ def build_list_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups") # pylint: disable=line-too-long
path_format_arguments = {
@@ -48,18 +52,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -71,9 +73,12 @@ def build_get_request(
backup_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -86,18 +91,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -109,8 +112,9 @@ def build_delete_request_initial(
backup_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -123,37 +127,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class AccountBackupsOperations(object):
- """AccountBackupsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class AccountBackupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`account_backups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -161,7 +162,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.BackupsList"]:
+ ) -> Iterable[_models.BackupsList]:
"""List Backups for a Netapp Account.
List all Backups for a Netapp Account.
@@ -175,13 +176,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -191,9 +195,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -203,9 +209,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -245,7 +253,7 @@ def get(
account_name: str,
backup_name: str,
**kwargs: Any
- ) -> "_models.Backup":
+ ) -> _models.Backup:
"""Get Backup for a Netapp Account.
Gets the specified backup for a Netapp Account.
@@ -261,13 +269,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.Backup
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
request = build_get_request(
@@ -277,11 +288,13 @@ def get(
backup_name=backup_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -309,13 +322,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -325,11 +341,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -376,21 +394,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_name=backup_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -400,8 +423,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py
index 09cd60007973d..893fe2d80e96f 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_accounts_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -33,9 +33,12 @@ def build_list_by_subscription_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts")
path_format_arguments = {
@@ -45,18 +48,16 @@ def build_list_by_subscription_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -66,9 +67,12 @@ def build_list_request(
resource_group_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts") # pylint: disable=line-too-long
path_format_arguments = {
@@ -79,18 +83,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -101,9 +103,12 @@ def build_get_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -115,18 +120,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -136,14 +139,17 @@ def build_create_or_update_request_initial(
resource_group_name: str,
account_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.NetAppAccount] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -155,20 +161,18 @@ def build_create_or_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -181,8 +185,9 @@ def build_delete_request_initial(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -194,13 +199,12 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -210,14 +214,17 @@ def build_update_request_initial(
resource_group_name: str,
account_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.NetAppAccountPatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -229,52 +236,48 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
)
-class AccountsOperations(object):
- """AccountsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class AccountsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`accounts` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_subscription(
self,
**kwargs: Any
- ) -> Iterable["_models.NetAppAccountList"]:
+ ) -> Iterable[_models.NetAppAccountList]:
"""Describe all NetApp Accounts in a subscription.
List and describe all NetApp accounts in the subscription.
@@ -284,13 +287,16 @@ def list_by_subscription(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.NetAppAccountList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccountList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccountList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -298,9 +304,11 @@ def prepare_request(next_link=None):
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list_by_subscription.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -308,9 +316,11 @@ def prepare_request(next_link=None):
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -348,7 +358,7 @@ def list(
self,
resource_group_name: str,
**kwargs: Any
- ) -> Iterable["_models.NetAppAccountList"]:
+ ) -> Iterable[_models.NetAppAccountList]:
"""Describe all NetApp Accounts in a resource group.
List and describe all NetApp accounts in the resource group.
@@ -360,13 +370,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.NetAppAccountList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccountList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccountList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -375,9 +388,11 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -386,9 +401,11 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -427,7 +444,7 @@ def get(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> "_models.NetAppAccount":
+ ) -> _models.NetAppAccount:
"""Describe a NetApp Account.
Get the NetApp account.
@@ -441,13 +458,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.NetAppAccount
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
request = build_get_request(
@@ -456,11 +476,13 @@ def get(
account_name=account_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -485,17 +507,20 @@ def _create_or_update_initial(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccount",
+ body: _models.NetAppAccount,
**kwargs: Any
- ) -> "_models.NetAppAccount":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
+ ) -> _models.NetAppAccount:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
_json = self._serialize.body(body, 'NetAppAccount')
@@ -507,11 +532,13 @@ def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -541,9 +568,9 @@ def begin_create_or_update(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccount",
+ body: _models.NetAppAccount,
**kwargs: Any
- ) -> LROPoller["_models.NetAppAccount"]:
+ ) -> LROPoller[_models.NetAppAccount]:
"""Create or update a NetApp account.
Create or update the specified NetApp account within the resource group.
@@ -567,37 +594,47 @@ def begin_create_or_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.NetAppAccount]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_or_update_initial(
+ raw_result = self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
body=body,
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('NetAppAccount', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -616,13 +653,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
account_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -631,11 +671,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
account_name=account_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -679,20 +721,25 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -702,8 +749,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -720,17 +773,20 @@ def _update_initial(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccountPatch",
+ body: _models.NetAppAccountPatch,
**kwargs: Any
- ) -> "_models.NetAppAccount":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
+ ) -> _models.NetAppAccount:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
_json = self._serialize.body(body, 'NetAppAccountPatch')
@@ -742,11 +798,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -776,9 +834,9 @@ def begin_update(
self,
resource_group_name: str,
account_name: str,
- body: "_models.NetAppAccountPatch",
+ body: _models.NetAppAccountPatch,
**kwargs: Any
- ) -> LROPoller["_models.NetAppAccount"]:
+ ) -> LROPoller[_models.NetAppAccount]:
"""Update a NetApp account.
Patch the specified NetApp account.
@@ -802,37 +860,47 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.NetAppAccount]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.NetAppAccount]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
body=body,
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('NetAppAccount', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py
index 4ce0bf25b8262..2454b43bb0152 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backup_policies_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -35,9 +35,12 @@ def build_list_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies") # pylint: disable=line-too-long
path_format_arguments = {
@@ -49,18 +52,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -72,9 +73,12 @@ def build_get_request(
backup_policy_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -87,18 +91,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -109,14 +111,17 @@ def build_create_request_initial(
account_name: str,
backup_policy_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.BackupPolicy] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -129,20 +134,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -155,14 +158,17 @@ def build_update_request_initial(
account_name: str,
backup_policy_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.BackupPolicyPatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -175,20 +181,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -202,8 +206,9 @@ def build_delete_request_initial(
backup_policy_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -216,37 +221,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class BackupPoliciesOperations(object):
- """BackupPoliciesOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class BackupPoliciesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`backup_policies` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -254,7 +256,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.BackupPoliciesList"]:
+ ) -> Iterable[_models.BackupPoliciesList]:
"""List backup policies.
List backup policies for Netapp Account.
@@ -268,13 +270,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupPoliciesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPoliciesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPoliciesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -284,9 +289,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -296,9 +303,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -338,7 +347,7 @@ def get(
account_name: str,
backup_policy_name: str,
**kwargs: Any
- ) -> "_models.BackupPolicy":
+ ) -> _models.BackupPolicy:
"""Get a backup Policy.
Get a particular backup Policy.
@@ -354,13 +363,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.BackupPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
request = build_get_request(
@@ -370,11 +382,13 @@ def get(
backup_policy_name=backup_policy_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -400,17 +414,20 @@ def _create_initial(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicy",
+ body: _models.BackupPolicy,
**kwargs: Any
- ) -> Optional["_models.BackupPolicy"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BackupPolicy"]]
+ ) -> Optional[_models.BackupPolicy]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.BackupPolicy]]
_json = self._serialize.body(body, 'BackupPolicy')
@@ -423,11 +440,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -459,9 +478,9 @@ def begin_create(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicy",
+ body: _models.BackupPolicy,
**kwargs: Any
- ) -> LROPoller["_models.BackupPolicy"]:
+ ) -> LROPoller[_models.BackupPolicy]:
"""Create a backup policy.
Create a backup policy for Netapp Account.
@@ -487,17 +506,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
@@ -505,20 +527,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('BackupPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -536,17 +565,20 @@ def _update_initial(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicyPatch",
+ body: _models.BackupPolicyPatch,
**kwargs: Any
- ) -> "_models.BackupPolicy":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
+ ) -> _models.BackupPolicy:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
_json = self._serialize.body(body, 'BackupPolicyPatch')
@@ -559,11 +591,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -594,9 +628,9 @@ def begin_update(
resource_group_name: str,
account_name: str,
backup_policy_name: str,
- body: "_models.BackupPolicyPatch",
+ body: _models.BackupPolicyPatch,
**kwargs: Any
- ) -> LROPoller["_models.BackupPolicy"]:
+ ) -> LROPoller[_models.BackupPolicy]:
"""Patch a backup policy.
Patch a backup policy for Netapp Account.
@@ -622,17 +656,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.BackupPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
@@ -640,20 +677,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('BackupPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -673,13 +717,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_policy_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -689,11 +736,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_policy_name=backup_policy_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -740,21 +789,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
backup_policy_name=backup_policy_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -764,8 +818,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py
index 793b77c6f405f..fd23910519162 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_backups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -37,9 +37,12 @@ def build_get_status_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus") # pylint: disable=line-too-long
path_format_arguments = {
@@ -53,18 +56,16 @@ def build_get_status_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -77,9 +78,12 @@ def build_get_volume_restore_status_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus") # pylint: disable=line-too-long
path_format_arguments = {
@@ -93,18 +97,16 @@ def build_get_volume_restore_status_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -117,9 +119,12 @@ def build_list_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups") # pylint: disable=line-too-long
path_format_arguments = {
@@ -133,18 +138,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -158,9 +161,12 @@ def build_get_request(
backup_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -175,18 +181,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -199,14 +203,17 @@ def build_create_request_initial(
volume_name: str,
backup_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.Backup] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -221,20 +228,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -249,14 +254,17 @@ def build_update_request_initial(
volume_name: str,
backup_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.BackupPatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -271,20 +279,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -300,8 +306,9 @@ def build_delete_request_initial(
backup_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -316,37 +323,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class BackupsOperations(object):
- """BackupsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class BackupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`backups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def get_status(
@@ -356,7 +360,7 @@ def get_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.BackupStatus":
+ ) -> _models.BackupStatus:
"""Get volume's backup status.
Get the status of the backup for a volume.
@@ -374,13 +378,16 @@ def get_status(
:rtype: ~azure.mgmt.netapp.models.BackupStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupStatus]
request = build_get_status_request(
@@ -391,11 +398,13 @@ def get_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.get_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -424,7 +433,7 @@ def get_volume_restore_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.RestoreStatus":
+ ) -> _models.RestoreStatus:
"""Get volume's restore status.
Get the status of the restore for a volume.
@@ -442,13 +451,16 @@ def get_volume_restore_status(
:rtype: ~azure.mgmt.netapp.models.RestoreStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.RestoreStatus]
request = build_get_volume_restore_status_request(
@@ -459,11 +471,13 @@ def get_volume_restore_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.get_volume_restore_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -492,7 +506,7 @@ def list(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> Iterable["_models.BackupsList"]:
+ ) -> Iterable[_models.BackupsList]:
"""List Backups.
List all backups for a volume.
@@ -510,13 +524,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.BackupsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.BackupsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -528,9 +545,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -542,9 +561,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -586,7 +607,7 @@ def get(
volume_name: str,
backup_name: str,
**kwargs: Any
- ) -> "_models.Backup":
+ ) -> _models.Backup:
"""Get a backup.
Gets the specified backup of the volume.
@@ -606,13 +627,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.Backup
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
request = build_get_request(
@@ -624,11 +648,13 @@ def get(
backup_name=backup_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -656,17 +682,20 @@ def _create_initial(
pool_name: str,
volume_name: str,
backup_name: str,
- body: "_models.Backup",
+ body: _models.Backup,
**kwargs: Any
- ) -> Optional["_models.Backup"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Backup"]]
+ ) -> Optional[_models.Backup]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Backup]]
_json = self._serialize.body(body, 'Backup')
@@ -681,11 +710,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -719,9 +750,9 @@ def begin_create(
pool_name: str,
volume_name: str,
backup_name: str,
- body: "_models.Backup",
+ body: _models.Backup,
**kwargs: Any
- ) -> LROPoller["_models.Backup"]:
+ ) -> LROPoller[_models.Backup]:
"""Create a backup.
Create a backup for the volume.
@@ -750,17 +781,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -770,20 +804,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Backup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -803,17 +844,20 @@ def _update_initial(
pool_name: str,
volume_name: str,
backup_name: str,
- body: Optional["_models.BackupPatch"] = None,
+ body: Optional[_models.BackupPatch] = None,
**kwargs: Any
- ) -> "_models.Backup":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
+ ) -> _models.Backup:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
if body is not None:
_json = self._serialize.body(body, 'BackupPatch')
@@ -831,11 +875,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -868,9 +914,9 @@ def begin_update(
pool_name: str,
volume_name: str,
backup_name: str,
- body: Optional["_models.BackupPatch"] = None,
+ body: Optional[_models.BackupPatch] = None,
**kwargs: Any
- ) -> LROPoller["_models.Backup"]:
+ ) -> LROPoller[_models.Backup]:
"""Patch a backup.
Patch a backup for the volume.
@@ -899,17 +945,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Backup]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Backup]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Backup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -919,20 +968,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Backup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -954,13 +1010,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -972,11 +1031,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1029,16 +1090,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1046,6 +1110,8 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
backup_name=backup_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1055,8 +1121,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py
index c6ea0067de859..30745faac1407 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_operations.py
@@ -15,12 +15,12 @@
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -30,14 +30,17 @@ def build_check_name_availability_request(
subscription_id: str,
location: str,
*,
- json: JSONType = None,
+ json: Optional[_models.ResourceNameAvailabilityRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability") # pylint: disable=line-too-long
path_format_arguments = {
@@ -48,20 +51,18 @@ def build_check_name_availability_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -72,14 +73,17 @@ def build_check_file_path_availability_request(
subscription_id: str,
location: str,
*,
- json: JSONType = None,
+ json: Optional[_models.FilePathAvailabilityRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability") # pylint: disable=line-too-long
path_format_arguments = {
@@ -90,20 +94,18 @@ def build_check_file_path_availability_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -114,14 +116,17 @@ def build_check_quota_availability_request(
subscription_id: str,
location: str,
*,
- json: JSONType = None,
+ json: Optional[_models.QuotaAvailabilityRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability") # pylint: disable=line-too-long
path_format_arguments = {
@@ -132,46 +137,42 @@ def build_check_quota_availability_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
)
-class NetAppResourceOperations(object):
- """NetAppResourceOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class NetAppResourceOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`net_app_resource` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def check_name_availability(
@@ -181,7 +182,7 @@ def check_name_availability(
type: Union[str, "_models.CheckNameResourceTypes"],
resource_group: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check resource name availability.
Check if a resource name is available.
@@ -199,14 +200,17 @@ def check_name_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.ResourceNameAvailabilityRequest(name=name, type=type, resource_group=resource_group)
_json = self._serialize.body(_body, 'ResourceNameAvailabilityRequest')
@@ -218,11 +222,13 @@ def check_name_availability(
content_type=content_type,
json=_json,
template_url=self.check_name_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -250,7 +256,7 @@ def check_file_path_availability(
name: str,
subnet_id: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check file path availability.
Check if a file path is available.
@@ -267,14 +273,17 @@ def check_file_path_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.FilePathAvailabilityRequest(name=name, subnet_id=subnet_id)
_json = self._serialize.body(_body, 'FilePathAvailabilityRequest')
@@ -286,11 +295,13 @@ def check_file_path_availability(
content_type=content_type,
json=_json,
template_url=self.check_file_path_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -319,7 +330,7 @@ def check_quota_availability(
type: Union[str, "_models.CheckQuotaNameResourceTypes"],
resource_group: str,
**kwargs: Any
- ) -> "_models.CheckAvailabilityResponse":
+ ) -> _models.CheckAvailabilityResponse:
"""Check quota availability.
Check if a quota is available.
@@ -337,14 +348,17 @@ def check_quota_availability(
:rtype: ~azure.mgmt.netapp.models.CheckAvailabilityResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckAvailabilityResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CheckAvailabilityResponse]
_body = _models.QuotaAvailabilityRequest(name=name, type=type, resource_group=resource_group)
_json = self._serialize.body(_body, 'QuotaAvailabilityRequest')
@@ -356,11 +370,13 @@ def check_quota_availability(
content_type=content_type,
json=_json,
template_url=self.check_quota_availability.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py
index 0be4b03b2d721..9834eb2b6be33 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_net_app_resource_quota_limits_operations.py
@@ -16,6 +16,7 @@
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
@@ -31,9 +32,12 @@ def build_list_request(
location: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits") # pylint: disable=line-too-long
path_format_arguments = {
@@ -44,18 +48,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -66,9 +68,12 @@ def build_get_request(
quota_limit_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -80,49 +85,45 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
-class NetAppResourceQuotaLimitsOperations(object):
- """NetAppResourceQuotaLimitsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class NetAppResourceQuotaLimitsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`net_app_resource_quota_limits` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
self,
location: str,
**kwargs: Any
- ) -> Iterable["_models.SubscriptionQuotaItemList"]:
+ ) -> Iterable[_models.SubscriptionQuotaItemList]:
"""Get quota limits.
Get the default and current limits for quotas.
@@ -135,13 +136,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SubscriptionQuotaItemList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubscriptionQuotaItemList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionQuotaItemList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -150,9 +154,11 @@ def prepare_request(next_link=None):
location=location,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -161,9 +167,11 @@ def prepare_request(next_link=None):
location=location,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -202,7 +210,7 @@ def get(
location: str,
quota_limit_name: str,
**kwargs: Any
- ) -> "_models.SubscriptionQuotaItem":
+ ) -> _models.SubscriptionQuotaItem:
"""Get quota limits.
Get the default and current subscription quota limit.
@@ -216,13 +224,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.SubscriptionQuotaItem
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionQuotaItem"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubscriptionQuotaItem]
request = build_get_request(
@@ -231,11 +242,13 @@ def get(
quota_limit_name=quota_limit_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py
index 3fe6321cd0cfb..ed3cf23b7809c 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_operations.py
@@ -16,6 +16,7 @@
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
@@ -29,55 +30,54 @@
def build_list_request(
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/providers/Microsoft.NetApp/operations")
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
-class Operations(object):
- """Operations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class Operations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`operations` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
self,
**kwargs: Any
- ) -> Iterable["_models.OperationListResult"]:
+ ) -> Iterable[_models.OperationListResult]:
"""Describes the Resource Provider.
Lists all of the available Microsoft.NetApp Rest API operations.
@@ -87,31 +87,38 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_patch.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_patch.py
new file mode 100644
index 0000000000000..0ad201a8c586e
--- /dev/null
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_patch.py
@@ -0,0 +1,19 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py
index 6f85628ae7edf..74c9f0fdfa543 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_pools_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -35,9 +35,12 @@ def build_list_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools") # pylint: disable=line-too-long
path_format_arguments = {
@@ -49,18 +52,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -72,9 +73,12 @@ def build_get_request(
pool_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -87,18 +91,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -109,14 +111,17 @@ def build_create_or_update_request_initial(
account_name: str,
pool_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.CapacityPool] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -129,20 +134,18 @@ def build_create_or_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -155,14 +158,17 @@ def build_update_request_initial(
account_name: str,
pool_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.CapacityPoolPatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -175,20 +181,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -202,8 +206,9 @@ def build_delete_request_initial(
pool_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -216,37 +221,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class PoolsOperations(object):
- """PoolsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class PoolsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`pools` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -254,7 +256,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.CapacityPoolList"]:
+ ) -> Iterable[_models.CapacityPoolList]:
"""Describe all Capacity Pools.
List all capacity pools in the NetApp Account.
@@ -268,13 +270,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.CapacityPoolList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPoolList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPoolList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -284,9 +289,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -296,9 +303,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -338,7 +347,7 @@ def get(
account_name: str,
pool_name: str,
**kwargs: Any
- ) -> "_models.CapacityPool":
+ ) -> _models.CapacityPool:
"""Describe a Capacity Pool.
Get details of the specified capacity pool.
@@ -354,13 +363,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.CapacityPool
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
request = build_get_request(
@@ -370,11 +382,13 @@ def get(
pool_name=pool_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -400,17 +414,20 @@ def _create_or_update_initial(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPool",
+ body: _models.CapacityPool,
**kwargs: Any
- ) -> "_models.CapacityPool":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
+ ) -> _models.CapacityPool:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
_json = self._serialize.body(body, 'CapacityPool')
@@ -423,11 +440,13 @@ def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -458,9 +477,9 @@ def begin_create_or_update(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPool",
+ body: _models.CapacityPool,
**kwargs: Any
- ) -> LROPoller["_models.CapacityPool"]:
+ ) -> LROPoller[_models.CapacityPool]:
"""Create or Update the specified capacity pool within the resource group.
Create or Update a capacity pool.
@@ -486,17 +505,20 @@ def begin_create_or_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.CapacityPool]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_or_update_initial(
+ raw_result = self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -504,20 +526,27 @@ def begin_create_or_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('CapacityPool', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -535,17 +564,20 @@ def _update_initial(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPoolPatch",
+ body: _models.CapacityPoolPatch,
**kwargs: Any
- ) -> Optional["_models.CapacityPool"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CapacityPool"]]
+ ) -> Optional[_models.CapacityPool]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.CapacityPool]]
_json = self._serialize.body(body, 'CapacityPoolPatch')
@@ -558,11 +590,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -591,9 +625,9 @@ def begin_update(
resource_group_name: str,
account_name: str,
pool_name: str,
- body: "_models.CapacityPoolPatch",
+ body: _models.CapacityPoolPatch,
**kwargs: Any
- ) -> LROPoller["_models.CapacityPool"]:
+ ) -> LROPoller[_models.CapacityPool]:
"""Update a capacity pool.
Patch the specified capacity pool.
@@ -619,17 +653,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.CapacityPool]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.CapacityPool]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.CapacityPool"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -637,20 +674,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('CapacityPool', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -670,13 +714,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
pool_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -686,11 +733,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
pool_name=pool_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -737,21 +786,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -761,8 +815,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py
index e05e6e93c1cce..e54b4aac01b85 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshot_policies_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -35,9 +35,12 @@ def build_list_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies") # pylint: disable=line-too-long
path_format_arguments = {
@@ -49,18 +52,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -72,9 +73,12 @@ def build_get_request(
snapshot_policy_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -87,18 +91,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -109,14 +111,17 @@ def build_create_request(
account_name: str,
snapshot_policy_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.SnapshotPolicy] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -129,20 +134,18 @@ def build_create_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -155,14 +158,17 @@ def build_update_request_initial(
account_name: str,
snapshot_policy_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.SnapshotPolicyPatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -175,20 +181,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -202,8 +206,9 @@ def build_delete_request_initial(
snapshot_policy_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -216,13 +221,12 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -234,9 +238,12 @@ def build_list_volumes_request(
snapshot_policy_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes") # pylint: disable=line-too-long
path_format_arguments = {
@@ -249,42 +256,38 @@ def build_list_volumes_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
-class SnapshotPoliciesOperations(object):
- """SnapshotPoliciesOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class SnapshotPoliciesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`snapshot_policies` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -292,7 +295,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.SnapshotPoliciesList"]:
+ ) -> Iterable[_models.SnapshotPoliciesList]:
"""List snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -305,13 +308,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SnapshotPoliciesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPoliciesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPoliciesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -321,9 +327,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -333,9 +341,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -375,7 +385,7 @@ def get(
account_name: str,
snapshot_policy_name: str,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
+ ) -> _models.SnapshotPolicy:
"""Get a snapshot Policy.
:param resource_group_name: The name of the resource group.
@@ -389,13 +399,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
request = build_get_request(
@@ -405,11 +418,13 @@ def get(
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -436,9 +451,9 @@ def create(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicy",
+ body: _models.SnapshotPolicy,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
+ ) -> _models.SnapshotPolicy:
"""Create a snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -454,14 +469,17 @@ def create(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
_json = self._serialize.body(body, 'SnapshotPolicy')
@@ -474,11 +492,13 @@ def create(
content_type=content_type,
json=_json,
template_url=self.create.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -508,17 +528,20 @@ def _update_initial(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicyPatch",
+ body: _models.SnapshotPolicyPatch,
**kwargs: Any
- ) -> "_models.SnapshotPolicy":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
+ ) -> _models.SnapshotPolicy:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
_json = self._serialize.body(body, 'SnapshotPolicyPatch')
@@ -531,11 +554,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -566,9 +591,9 @@ def begin_update(
resource_group_name: str,
account_name: str,
snapshot_policy_name: str,
- body: "_models.SnapshotPolicyPatch",
+ body: _models.SnapshotPolicyPatch,
**kwargs: Any
- ) -> LROPoller["_models.SnapshotPolicy"]:
+ ) -> LROPoller[_models.SnapshotPolicy]:
"""Patch a snapshot policy.
:param resource_group_name: The name of the resource group.
@@ -592,17 +617,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SnapshotPolicy]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicy]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicy"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
snapshot_policy_name=snapshot_policy_name,
@@ -610,20 +638,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SnapshotPolicy', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -643,13 +678,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_policy_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -659,11 +697,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -708,21 +748,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -732,8 +777,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -753,7 +804,7 @@ def list_volumes(
account_name: str,
snapshot_policy_name: str,
**kwargs: Any
- ) -> "_models.SnapshotPolicyVolumeList":
+ ) -> _models.SnapshotPolicyVolumeList:
"""Get volumes for snapshot policy.
Get volumes associated with snapshot policy.
@@ -769,13 +820,16 @@ def list_volumes(
:rtype: ~azure.mgmt.netapp.models.SnapshotPolicyVolumeList
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotPolicyVolumeList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotPolicyVolumeList]
request = build_list_volumes_request(
@@ -785,11 +839,13 @@ def list_volumes(
snapshot_policy_name=snapshot_policy_name,
api_version=api_version,
template_url=self.list_volumes.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py
index 04bfb2e1f17a4..b335d86e68155 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -37,9 +37,12 @@ def build_list_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots") # pylint: disable=line-too-long
path_format_arguments = {
@@ -53,18 +56,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -78,9 +79,12 @@ def build_get_request(
snapshot_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -95,18 +99,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -119,14 +121,17 @@ def build_create_request_initial(
volume_name: str,
snapshot_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.Snapshot] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -141,20 +146,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -169,14 +172,17 @@ def build_update_request_initial(
volume_name: str,
snapshot_name: str,
*,
- json: JSONType = None,
+ json: Any = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -191,20 +197,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -220,8 +224,9 @@ def build_delete_request_initial(
snapshot_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -236,13 +241,12 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -255,13 +259,15 @@ def build_restore_files_request_initial(
volume_name: str,
snapshot_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.SnapshotRestoreFiles] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles") # pylint: disable=line-too-long
path_format_arguments = {
@@ -276,45 +282,41 @@ def build_restore_files_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
)
-class SnapshotsOperations(object):
- """SnapshotsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class SnapshotsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`snapshots` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -324,7 +326,7 @@ def list(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> Iterable["_models.SnapshotsList"]:
+ ) -> Iterable[_models.SnapshotsList]:
"""Describe all snapshots.
List all snapshots associated with the volume.
@@ -342,13 +344,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SnapshotsList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotsList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotsList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -360,9 +365,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -374,9 +381,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -418,7 +427,7 @@ def get(
volume_name: str,
snapshot_name: str,
**kwargs: Any
- ) -> "_models.Snapshot":
+ ) -> _models.Snapshot:
"""Describe a snapshot.
Get details of the specified snapshot.
@@ -438,13 +447,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.Snapshot
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
request = build_get_request(
@@ -456,11 +468,13 @@ def get(
snapshot_name=snapshot_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -488,17 +502,20 @@ def _create_initial(
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.Snapshot",
+ body: _models.Snapshot,
**kwargs: Any
- ) -> Optional["_models.Snapshot"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Snapshot"]]
+ ) -> Optional[_models.Snapshot]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Snapshot]]
_json = self._serialize.body(body, 'Snapshot')
@@ -513,11 +530,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -548,9 +567,9 @@ def begin_create(
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.Snapshot",
+ body: _models.Snapshot,
**kwargs: Any
- ) -> LROPoller["_models.Snapshot"]:
+ ) -> LROPoller[_models.Snapshot]:
"""Create a snapshot.
Create the specified snapshot within the given volume.
@@ -579,17 +598,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -599,20 +621,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Snapshot', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -634,15 +663,18 @@ def _update_initial(
snapshot_name: str,
body: Any,
**kwargs: Any
- ) -> Optional["_models.Snapshot"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Snapshot"]]
+ ) -> Optional[_models.Snapshot]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Snapshot]]
_json = self._serialize.body(body, 'object')
@@ -657,11 +689,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -694,7 +728,7 @@ def begin_update(
snapshot_name: str,
body: Any,
**kwargs: Any
- ) -> LROPoller["_models.Snapshot"]:
+ ) -> LROPoller[_models.Snapshot]:
"""Update a snapshot.
Patch a snapshot.
@@ -723,17 +757,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Snapshot]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -743,20 +780,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Snapshot', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -778,13 +822,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -796,11 +843,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
snapshot_name=snapshot_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -853,16 +902,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -870,6 +922,8 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
snapshot_name=snapshot_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -879,8 +933,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -900,17 +960,20 @@ def _restore_files_initial( # pylint: disable=inconsistent-return-statements
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.SnapshotRestoreFiles",
+ body: _models.SnapshotRestoreFiles,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'SnapshotRestoreFiles')
@@ -925,11 +988,13 @@ def _restore_files_initial( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
template_url=self._restore_files_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -954,7 +1019,7 @@ def begin_restore_files( # pylint: disable=inconsistent-return-statements
pool_name: str,
volume_name: str,
snapshot_name: str,
- body: "_models.SnapshotRestoreFiles",
+ body: _models.SnapshotRestoreFiles,
**kwargs: Any
) -> LROPoller[None]:
"""Create a new Snapshot Restore Files request.
@@ -985,17 +1050,20 @@ def begin_restore_files( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._restore_files_initial(
+ raw_result = self._restore_files_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1005,6 +1073,8 @@ def begin_restore_files( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1014,8 +1084,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py
index bcb5ca4bdaa6b..b5f3f2efcc324 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_subvolumes_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -37,9 +37,12 @@ def build_list_by_volume_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes") # pylint: disable=line-too-long
path_format_arguments = {
@@ -53,18 +56,16 @@ def build_list_by_volume_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -78,9 +79,12 @@ def build_get_request(
subvolume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -95,18 +99,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -119,14 +121,17 @@ def build_create_request_initial(
volume_name: str,
subvolume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.SubvolumeInfo] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -141,20 +146,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -169,14 +172,17 @@ def build_update_request_initial(
volume_name: str,
subvolume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.SubvolumePatchRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -191,20 +197,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -220,8 +224,9 @@ def build_delete_request_initial(
subvolume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -236,13 +241,12 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -256,9 +260,12 @@ def build_get_metadata_request_initial(
subvolume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata") # pylint: disable=line-too-long
path_format_arguments = {
@@ -273,42 +280,38 @@ def build_get_metadata_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
-class SubvolumesOperations(object):
- """SubvolumesOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class SubvolumesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`subvolumes` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_volume(
@@ -318,7 +321,7 @@ def list_by_volume(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> Iterable["_models.SubvolumesList"]:
+ ) -> Iterable[_models.SubvolumesList]:
"""List of all the subvolumes.
Returns a list of the subvolumes in the volume.
@@ -336,13 +339,16 @@ def list_by_volume(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.SubvolumesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -354,9 +360,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_by_volume.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -368,9 +376,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -412,7 +422,7 @@ def get(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> "_models.SubvolumeInfo":
+ ) -> _models.SubvolumeInfo:
"""Get the path associated with the subvolumeName.
Returns the path associated with the subvolumeName provided.
@@ -432,13 +442,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.SubvolumeInfo
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
request = build_get_request(
@@ -450,11 +463,13 @@ def get(
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -482,17 +497,20 @@ def _create_initial(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumeInfo",
+ body: _models.SubvolumeInfo,
**kwargs: Any
- ) -> Optional["_models.SubvolumeInfo"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]]
+ ) -> Optional[_models.SubvolumeInfo]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeInfo]]
_json = self._serialize.body(body, 'SubvolumeInfo')
@@ -507,11 +525,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -545,9 +565,9 @@ def begin_create(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumeInfo",
+ body: _models.SubvolumeInfo,
**kwargs: Any
- ) -> LROPoller["_models.SubvolumeInfo"]:
+ ) -> LROPoller[_models.SubvolumeInfo]:
"""Create or clone a new subvolume.
Creates a subvolume in the path or clones the subvolume mentioned in the parentPath.
@@ -577,17 +597,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeInfo]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -597,20 +620,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeInfo', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -630,17 +660,20 @@ def _update_initial(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumePatchRequest",
+ body: _models.SubvolumePatchRequest,
**kwargs: Any
- ) -> Optional["_models.SubvolumeInfo"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeInfo"]]
+ ) -> Optional[_models.SubvolumeInfo]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeInfo]]
_json = self._serialize.body(body, 'SubvolumePatchRequest')
@@ -655,11 +688,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -690,9 +725,9 @@ def begin_update(
pool_name: str,
volume_name: str,
subvolume_name: str,
- body: "_models.SubvolumePatchRequest",
+ body: _models.SubvolumePatchRequest,
**kwargs: Any
- ) -> LROPoller["_models.SubvolumeInfo"]:
+ ) -> LROPoller[_models.SubvolumeInfo]:
"""Update a subvolume.
Patch a subvolume.
@@ -722,17 +757,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeInfo]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeInfo]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeInfo"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -742,20 +780,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeInfo', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -777,13 +822,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
subvolume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -795,11 +843,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -852,16 +902,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -869,6 +922,8 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
subvolume_name=subvolume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -878,8 +933,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -900,14 +961,17 @@ def _get_metadata_initial(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> Optional["_models.SubvolumeModel"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.SubvolumeModel"]]
+ ) -> Optional[_models.SubvolumeModel]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.SubvolumeModel]]
request = build_get_metadata_request_initial(
@@ -919,11 +983,13 @@ def _get_metadata_initial(
subvolume_name=subvolume_name,
api_version=api_version,
template_url=self._get_metadata_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -955,7 +1021,7 @@ def begin_get_metadata(
volume_name: str,
subvolume_name: str,
**kwargs: Any
- ) -> LROPoller["_models.SubvolumeModel"]:
+ ) -> LROPoller[_models.SubvolumeModel]:
"""Describe a subvolume.
Get details of the specified subvolume.
@@ -983,16 +1049,19 @@ def begin_get_metadata(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.SubvolumeModel]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.SubvolumeModel]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.SubvolumeModel"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._get_metadata_initial(
+ raw_result = self._get_metadata_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1000,20 +1069,27 @@ def begin_get_metadata(
subvolume_name=subvolume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('SubvolumeModel', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py
index 38378a1a936f6..60a37b2368b6a 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_vaults_operations.py
@@ -16,6 +16,7 @@
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
@@ -32,9 +33,12 @@ def build_list_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults") # pylint: disable=line-too-long
path_format_arguments = {
@@ -46,42 +50,38 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
-class VaultsOperations(object):
- """VaultsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class VaultsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`vaults` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -89,7 +89,7 @@ def list(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.VaultList"]:
+ ) -> Iterable[_models.VaultList]:
"""List vaults.
List vaults for a Netapp Account.
@@ -103,13 +103,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VaultList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VaultList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -119,9 +122,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -131,9 +136,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py
index 9d9a9a0c4b1ae..74a8f41495d91 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_groups_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -35,9 +35,12 @@ def build_list_by_net_app_account_request(
account_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups") # pylint: disable=line-too-long
path_format_arguments = {
@@ -49,18 +52,16 @@ def build_list_by_net_app_account_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -72,9 +73,12 @@ def build_get_request(
volume_group_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -87,18 +91,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -109,14 +111,17 @@ def build_create_request_initial(
account_name: str,
volume_group_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.VolumeGroupDetails] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -129,20 +134,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -156,8 +159,9 @@ def build_delete_request_initial(
volume_group_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -170,37 +174,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class VolumeGroupsOperations(object):
- """VolumeGroupsOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class VolumeGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`volume_groups` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_net_app_account(
@@ -208,7 +209,7 @@ def list_by_net_app_account(
resource_group_name: str,
account_name: str,
**kwargs: Any
- ) -> Iterable["_models.VolumeGroupList"]:
+ ) -> Iterable[_models.VolumeGroupList]:
"""Describe all volume groups.
List all volume groups for given account.
@@ -222,13 +223,16 @@ def list_by_net_app_account(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeGroupList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -238,9 +242,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=self.list_by_net_app_account.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -250,9 +256,11 @@ def prepare_request(next_link=None):
account_name=account_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -292,7 +300,7 @@ def get(
account_name: str,
volume_group_name: str,
**kwargs: Any
- ) -> "_models.VolumeGroupDetails":
+ ) -> _models.VolumeGroupDetails:
"""Describe a Volume Group.
Get details of the specified volume group.
@@ -308,13 +316,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.VolumeGroupDetails
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
request = build_get_request(
@@ -324,11 +335,13 @@ def get(
volume_group_name=volume_group_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -354,17 +367,20 @@ def _create_initial(
resource_group_name: str,
account_name: str,
volume_group_name: str,
- body: "_models.VolumeGroupDetails",
+ body: _models.VolumeGroupDetails,
**kwargs: Any
- ) -> "_models.VolumeGroupDetails":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
+ ) -> _models.VolumeGroupDetails:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
_json = self._serialize.body(body, 'VolumeGroupDetails')
@@ -377,11 +393,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -408,9 +426,9 @@ def begin_create(
resource_group_name: str,
account_name: str,
volume_group_name: str,
- body: "_models.VolumeGroupDetails",
+ body: _models.VolumeGroupDetails,
**kwargs: Any
- ) -> LROPoller["_models.VolumeGroupDetails"]:
+ ) -> LROPoller[_models.VolumeGroupDetails]:
"""Create the specified volume group and volumes. Creating volume group will create all the
volumes specified in request body implicitly. Once volumes are created using volume group,
those will be treated as regular volumes thereafter.
@@ -438,17 +456,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeGroupDetails]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeGroupDetails]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeGroupDetails"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
volume_group_name=volume_group_name,
@@ -456,20 +477,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeGroupDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -489,13 +517,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_group_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -505,11 +536,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_group_name=volume_group_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -556,21 +589,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
volume_group_name=volume_group_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -580,8 +618,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py
index 3ed917a0469ac..f436eb8c2ca22 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volume_quota_rules_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -37,9 +37,12 @@ def build_list_by_volume_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules") # pylint: disable=line-too-long
path_format_arguments = {
@@ -53,18 +56,16 @@ def build_list_by_volume_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -78,9 +79,12 @@ def build_get_request(
volume_quota_rule_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -95,18 +99,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -119,14 +121,17 @@ def build_create_request_initial(
volume_name: str,
volume_quota_rule_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.VolumeQuotaRule] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -141,20 +146,18 @@ def build_create_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -169,14 +172,17 @@ def build_update_request_initial(
volume_name: str,
volume_quota_rule_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.VolumeQuotaRulePatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -191,20 +197,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -220,8 +224,9 @@ def build_delete_request_initial(
volume_quota_rule_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -236,37 +241,34 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class VolumeQuotaRulesOperations(object):
- """VolumeQuotaRulesOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class VolumeQuotaRulesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`volume_quota_rules` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list_by_volume(
@@ -276,7 +278,7 @@ def list_by_volume(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> Iterable["_models.VolumeQuotaRulesList"]:
+ ) -> Iterable[_models.VolumeQuotaRulesList]:
"""Get all quota rules for a volume.
List all quota rules associated with the volume.
@@ -295,13 +297,16 @@ def list_by_volume(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeQuotaRulesList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRulesList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRulesList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -313,9 +318,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_by_volume.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -327,9 +334,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -371,7 +380,7 @@ def get(
volume_name: str,
volume_quota_rule_name: str,
**kwargs: Any
- ) -> "_models.VolumeQuotaRule":
+ ) -> _models.VolumeQuotaRule:
"""Describe a quota rule.
Get details of the specified quota rule.
@@ -391,13 +400,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.VolumeQuotaRule
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
request = build_get_request(
@@ -409,11 +421,13 @@ def get(
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -441,17 +455,20 @@ def _create_initial(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRule",
+ body: _models.VolumeQuotaRule,
**kwargs: Any
- ) -> "_models.VolumeQuotaRule":
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
+ ) -> _models.VolumeQuotaRule:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
_json = self._serialize.body(body, 'VolumeQuotaRule')
@@ -466,11 +483,13 @@ def _create_initial(
content_type=content_type,
json=_json,
template_url=self._create_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -503,9 +522,9 @@ def begin_create(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRule",
+ body: _models.VolumeQuotaRule,
**kwargs: Any
- ) -> LROPoller["_models.VolumeQuotaRule"]:
+ ) -> LROPoller[_models.VolumeQuotaRule]:
"""Create a quota rule.
Create the specified quota rule within the given volume.
@@ -535,17 +554,20 @@ def begin_create(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_initial(
+ raw_result = self._create_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -555,20 +577,27 @@ def begin_create(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeQuotaRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -588,17 +617,20 @@ def _update_initial(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRulePatch",
+ body: _models.VolumeQuotaRulePatch,
**kwargs: Any
- ) -> Optional["_models.VolumeQuotaRule"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VolumeQuotaRule"]]
+ ) -> Optional[_models.VolumeQuotaRule]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.VolumeQuotaRule]]
_json = self._serialize.body(body, 'VolumeQuotaRulePatch')
@@ -613,11 +645,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -648,9 +682,9 @@ def begin_update(
pool_name: str,
volume_name: str,
volume_quota_rule_name: str,
- body: "_models.VolumeQuotaRulePatch",
+ body: _models.VolumeQuotaRulePatch,
**kwargs: Any
- ) -> LROPoller["_models.VolumeQuotaRule"]:
+ ) -> LROPoller[_models.VolumeQuotaRule]:
"""Update a quota rule.
Patch a quota rule.
@@ -680,17 +714,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.VolumeQuotaRule]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeQuotaRule]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeQuotaRule"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -700,20 +737,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('VolumeQuotaRule', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -735,13 +779,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -753,11 +800,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -810,16 +859,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -827,6 +879,8 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
volume_quota_rule_name=volume_quota_rule_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -836,8 +890,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
diff --git a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py
index eb0b4c6b04b90..c4e4699a6c6ba 100644
--- a/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py
+++ b/sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py
@@ -6,7 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast
from msrest import Serializer
@@ -17,13 +17,13 @@
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
-JSONType = Any
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -36,9 +36,12 @@ def build_list_request(
pool_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes") # pylint: disable=line-too-long
path_format_arguments = {
@@ -51,18 +54,16 @@ def build_list_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -75,9 +76,12 @@ def build_get_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -91,18 +95,16 @@ def build_get_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -114,14 +116,17 @@ def build_create_or_update_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.Volume] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -135,20 +140,18 @@ def build_create_or_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PUT",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -162,14 +165,17 @@ def build_update_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.VolumePatch] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -183,20 +189,18 @@ def build_update_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -213,8 +217,9 @@ def build_delete_request_initial(
force_delete: Optional[bool] = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") # pylint: disable=line-too-long
path_format_arguments = {
@@ -228,15 +233,14 @@ def build_delete_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if force_delete is not None:
- _query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool')
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="DELETE",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -248,13 +252,15 @@ def build_revert_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.VolumeRevert] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") # pylint: disable=line-too-long
path_format_arguments = {
@@ -268,19 +274,17 @@ def build_revert_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -295,8 +299,9 @@ def build_reset_cifs_password_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resetCifsPassword") # pylint: disable=line-too-long
path_format_arguments = {
@@ -310,13 +315,12 @@ def build_reset_cifs_password_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -328,13 +332,15 @@ def build_break_replication_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.BreakReplicationRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") # pylint: disable=line-too-long
path_format_arguments = {
@@ -348,19 +354,63 @@ def build_break_replication_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
+ json=json,
+ content=content,
+ **kwargs
+ )
+
+
+def build_reestablish_replication_request_initial(
+ subscription_id: str,
+ resource_group_name: str,
+ account_name: str,
+ pool_name: str,
+ volume_name: str,
+ *,
+ json: Optional[_models.ReestablishReplicationRequest] = None,
+ content: Any = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication") # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
+ "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
+ "accountName": _SERIALIZER.url("account_name", account_name, 'str'),
+ "poolName": _SERIALIZER.url("pool_name", pool_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'),
+ "volumeName": _SERIALIZER.url("volume_name", volume_name, 'str', max_length=64, min_length=1, pattern=r'^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$'),
+ }
+
+ _url = _format_url_section(_url, **path_format_arguments)
+
+ # Construct parameters
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+
+ # Construct headers
+ if content_type is not None:
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -375,9 +425,12 @@ def build_replication_status_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus") # pylint: disable=line-too-long
path_format_arguments = {
@@ -391,18 +444,16 @@ def build_replication_status_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -415,9 +466,12 @@ def build_list_replications_request(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ accept = _headers.pop('Accept', "application/json")
- accept = "application/json"
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/listReplications") # pylint: disable=line-too-long
path_format_arguments = {
@@ -431,18 +485,16 @@ def build_list_replications_request(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
- _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
**kwargs
)
@@ -455,8 +507,9 @@ def build_resync_replication_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") # pylint: disable=line-too-long
path_format_arguments = {
@@ -470,13 +523,12 @@ def build_resync_replication_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -489,8 +541,9 @@ def build_delete_replication_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") # pylint: disable=line-too-long
path_format_arguments = {
@@ -504,13 +557,12 @@ def build_delete_replication_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -522,13 +574,15 @@ def build_authorize_replication_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.AuthorizeRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") # pylint: disable=line-too-long
path_format_arguments = {
@@ -542,19 +596,17 @@ def build_authorize_replication_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -569,8 +621,9 @@ def build_re_initialize_replication_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication") # pylint: disable=line-too-long
path_format_arguments = {
@@ -584,13 +637,12 @@ def build_re_initialize_replication_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -602,13 +654,15 @@ def build_pool_change_request_initial(
pool_name: str,
volume_name: str,
*,
- json: JSONType = None,
+ json: Optional[_models.PoolChangeRequest] = None,
content: Any = None,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', None) # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str]
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange") # pylint: disable=line-too-long
path_format_arguments = {
@@ -622,19 +676,17 @@ def build_pool_change_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
- _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
+ _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
- headers=_header_parameters,
+ params=_params,
+ headers=_headers,
json=json,
content=content,
**kwargs
@@ -649,8 +701,9 @@ def build_relocate_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/relocate") # pylint: disable=line-too-long
path_format_arguments = {
@@ -664,13 +717,12 @@ def build_relocate_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -683,8 +735,9 @@ def build_finalize_relocation_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeRelocation") # pylint: disable=line-too-long
path_format_arguments = {
@@ -698,13 +751,12 @@ def build_finalize_relocation_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
@@ -717,8 +769,9 @@ def build_revert_relocation_request_initial(
volume_name: str,
**kwargs: Any
) -> HttpRequest:
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revertRelocation") # pylint: disable=line-too-long
path_format_arguments = {
@@ -732,37 +785,34 @@ def build_revert_relocation_request_initial(
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
- _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
- _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
return HttpRequest(
method="POST",
url=_url,
- params=_query_parameters,
+ params=_params,
**kwargs
)
-class VolumesOperations(object): # pylint: disable=too-many-public-methods
- """VolumesOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- instantiates it for you and attaches it as an attribute.
+class VolumesOperations: # pylint: disable=too-many-public-methods
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
- :ivar models: Alias to model classes used in this operation group.
- :type models: ~azure.mgmt.netapp.models
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.netapp.NetAppManagementClient`'s
+ :attr:`volumes` attribute.
"""
models = _models
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
@distributed_trace
def list(
@@ -771,7 +821,7 @@ def list(
account_name: str,
pool_name: str,
**kwargs: Any
- ) -> Iterable["_models.VolumeList"]:
+ ) -> Iterable[_models.VolumeList]:
"""Describe all volumes.
List all volumes within the capacity pool.
@@ -787,13 +837,16 @@ def list(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.VolumeList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.VolumeList]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.VolumeList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -804,9 +857,11 @@ def prepare_request(next_link=None):
pool_name=pool_name,
api_version=api_version,
template_url=self.list.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -817,9 +872,11 @@ def prepare_request(next_link=None):
pool_name=pool_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -860,7 +917,7 @@ def get(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.Volume":
+ ) -> _models.Volume:
"""Describe a volume.
Get the details of the specified volume.
@@ -878,13 +935,16 @@ def get(
:rtype: ~azure.mgmt.netapp.models.Volume
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
request = build_get_request(
@@ -895,11 +955,13 @@ def get(
volume_name=volume_name,
api_version=api_version,
template_url=self.get.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -926,17 +988,20 @@ def _create_or_update_initial(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.Volume",
+ body: _models.Volume,
**kwargs: Any
- ) -> Optional["_models.Volume"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Volume"]]
+ ) -> Optional[_models.Volume]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Volume]]
_json = self._serialize.body(body, 'Volume')
@@ -950,11 +1015,13 @@ def _create_or_update_initial(
content_type=content_type,
json=_json,
template_url=self._create_or_update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -987,9 +1054,9 @@ def begin_create_or_update(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.Volume",
+ body: _models.Volume,
**kwargs: Any
- ) -> LROPoller["_models.Volume"]:
+ ) -> LROPoller[_models.Volume]:
"""Create or Update a volume.
Create or update the specified volume within the capacity pool.
@@ -1016,17 +1083,20 @@ def begin_create_or_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._create_or_update_initial(
+ raw_result = self._create_or_update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1035,20 +1105,27 @@ def begin_create_or_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Volume', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'azure-async-operation'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1067,17 +1144,20 @@ def _update_initial(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumePatch",
+ body: _models.VolumePatch,
**kwargs: Any
- ) -> Optional["_models.Volume"]:
- cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Volume"]]
+ ) -> Optional[_models.Volume]:
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.Volume]]
_json = self._serialize.body(body, 'VolumePatch')
@@ -1091,11 +1171,13 @@ def _update_initial(
content_type=content_type,
json=_json,
template_url=self._update_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1125,9 +1207,9 @@ def begin_update(
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumePatch",
+ body: _models.VolumePatch,
**kwargs: Any
- ) -> LROPoller["_models.Volume"]:
+ ) -> LROPoller[_models.Volume]:
"""Update a volume.
Patch the specified volume.
@@ -1154,17 +1236,20 @@ def begin_update(
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.Volume]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.Volume]
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.Volume"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._update_initial(
+ raw_result = self._update_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1173,20 +1258,27 @@ def begin_update(
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- response = pipeline_response.http_response
deserialized = self._deserialize('Volume', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1208,13 +1300,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
force_delete: Optional[bool] = None,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_request_initial(
@@ -1226,11 +1321,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
api_version=api_version,
force_delete=force_delete,
template_url=self._delete_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1284,16 +1381,19 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_initial(
+ raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1301,6 +1401,8 @@ def begin_delete( # pylint: disable=inconsistent-return-statements
force_delete=force_delete,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1310,8 +1412,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1330,17 +1438,20 @@ def _revert_initial( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumeRevert",
+ body: _models.VolumeRevert,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'VolumeRevert')
@@ -1354,11 +1465,13 @@ def _revert_initial( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
template_url=self._revert_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1382,7 +1495,7 @@ def begin_revert( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.VolumeRevert",
+ body: _models.VolumeRevert,
**kwargs: Any
) -> LROPoller[None]:
"""Revert a volume to one of its snapshots.
@@ -1411,17 +1524,20 @@ def begin_revert( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._revert_initial(
+ raw_result = self._revert_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1430,6 +1546,8 @@ def begin_revert( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1439,8 +1557,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1461,13 +1585,16 @@ def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-stateme
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_reset_cifs_password_request_initial(
@@ -1478,11 +1605,13 @@ def _reset_cifs_password_initial( # pylint: disable=inconsistent-return-stateme
volume_name=volume_name,
api_version=api_version,
template_url=self._reset_cifs_password_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1532,22 +1661,27 @@ def begin_reset_cifs_password( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._reset_cifs_password_initial(
+ raw_result = self._reset_cifs_password_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1557,8 +1691,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1577,17 +1717,20 @@ def _break_replication_initial( # pylint: disable=inconsistent-return-statement
account_name: str,
pool_name: str,
volume_name: str,
- body: Optional["_models.BreakReplicationRequest"] = None,
+ body: Optional[_models.BreakReplicationRequest] = None,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
if body is not None:
_json = self._serialize.body(body, 'BreakReplicationRequest')
@@ -1604,11 +1747,13 @@ def _break_replication_initial( # pylint: disable=inconsistent-return-statement
content_type=content_type,
json=_json,
template_url=self._break_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1632,7 +1777,7 @@ def begin_break_replication( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: Optional["_models.BreakReplicationRequest"] = None,
+ body: Optional[_models.BreakReplicationRequest] = None,
**kwargs: Any
) -> LROPoller[None]:
"""Break volume replication.
@@ -1661,17 +1806,20 @@ def begin_break_replication( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._break_replication_initial(
+ raw_result = self._break_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -1680,6 +1828,8 @@ def begin_break_replication( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1689,8 +1839,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1703,6 +1859,152 @@ def get_long_running_output(pipeline_response):
begin_break_replication.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication"} # type: ignore
+ def _reestablish_replication_initial( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ account_name: str,
+ pool_name: str,
+ volume_name: str,
+ body: _models.ReestablishReplicationRequest,
+ **kwargs: Any
+ ) -> None:
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+
+ _json = self._serialize.body(body, 'ReestablishReplicationRequest')
+
+ request = build_reestablish_replication_request_initial(
+ subscription_id=self._config.subscription_id,
+ resource_group_name=resource_group_name,
+ account_name=account_name,
+ pool_name=pool_name,
+ volume_name=volume_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ template_url=self._reestablish_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
+ )
+ request = _convert_request(request)
+ request.url = self._client.format_url(request.url) # type: ignore
+
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
+ request,
+ stream=False,
+ **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {})
+
+ _reestablish_replication_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication"} # type: ignore
+
+
+ @distributed_trace
+ def begin_reestablish_replication( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ account_name: str,
+ pool_name: str,
+ volume_name: str,
+ body: _models.ReestablishReplicationRequest,
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Re-establish volume replication.
+
+ Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or
+ policy-based snapshots.
+
+ :param resource_group_name: The name of the resource group.
+ :type resource_group_name: str
+ :param account_name: The name of the NetApp account.
+ :type account_name: str
+ :param pool_name: The name of the capacity pool.
+ :type pool_name: str
+ :param volume_name: The name of the volume.
+ :type volume_name: str
+ :param body: body for the id of the source volume.
+ :type body: ~azure.mgmt.netapp.models.ReestablishReplicationRequest
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :keyword str continuation_token: A continuation token to restart a poller from a saved state.
+ :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
+ operation to not poll, or pass in your own initialized polling object for a personal polling
+ strategy.
+ :paramtype polling: bool or ~azure.core.polling.PollingMethod
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
+ )
+ cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
+ if cont_token is None:
+ raw_result = self._reestablish_replication_initial( # type: ignore
+ resource_group_name=resource_group_name,
+ account_name=account_name,
+ pool_name=pool_name,
+ volume_name=volume_name,
+ body=body,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ kwargs.pop('error_map', None)
+
+ def get_long_running_output(pipeline_response):
+ if cls:
+ return cls(pipeline_response, None, {})
+
+
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
+ else: polling_method = polling
+ if cont_token:
+ return LROPoller.from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output
+ )
+ return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
+
+ begin_reestablish_replication.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication"} # type: ignore
+
@distributed_trace
def replication_status(
self,
@@ -1711,7 +2013,7 @@ def replication_status(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> "_models.ReplicationStatus":
+ ) -> _models.ReplicationStatus:
"""Get volume replication status.
Get the status of the replication.
@@ -1729,13 +2031,16 @@ def replication_status(
:rtype: ~azure.mgmt.netapp.models.ReplicationStatus
:raises: ~azure.core.exceptions.HttpResponseError
"""
- cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationStatus"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.ReplicationStatus]
request = build_replication_status_request(
@@ -1746,11 +2051,13 @@ def replication_status(
volume_name=volume_name,
api_version=api_version,
template_url=self.replication_status.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1779,7 +2086,7 @@ def list_replications(
pool_name: str,
volume_name: str,
**kwargs: Any
- ) -> Iterable["_models.ListReplications"]:
+ ) -> Iterable[_models.ListReplications]:
"""List replications for volume.
List all replications for a specified volume.
@@ -1797,13 +2104,16 @@ def list_replications(
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.netapp.models.ListReplications]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[_models.ListReplications]
- cls = kwargs.pop('cls', None) # type: ClsType["_models.ListReplications"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
def prepare_request(next_link=None):
if not next_link:
@@ -1815,9 +2125,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=self.list_replications.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
else:
@@ -1829,9 +2141,11 @@ def prepare_request(next_link=None):
volume_name=volume_name,
api_version=api_version,
template_url=next_link,
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
return request
@@ -1872,13 +2186,16 @@ def _resync_replication_initial( # pylint: disable=inconsistent-return-statemen
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_resync_replication_request_initial(
@@ -1889,11 +2206,13 @@ def _resync_replication_initial( # pylint: disable=inconsistent-return-statemen
volume_name=volume_name,
api_version=api_version,
template_url=self._resync_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -1944,22 +2263,27 @@ def begin_resync_replication( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._resync_replication_initial(
+ raw_result = self._resync_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -1969,8 +2293,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -1991,13 +2321,16 @@ def _delete_replication_initial( # pylint: disable=inconsistent-return-statemen
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_delete_replication_request_initial(
@@ -2008,11 +2341,13 @@ def _delete_replication_initial( # pylint: disable=inconsistent-return-statemen
volume_name=volume_name,
api_version=api_version,
template_url=self._delete_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2063,22 +2398,27 @@ def begin_delete_replication( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._delete_replication_initial(
+ raw_result = self._delete_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2088,8 +2428,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2108,17 +2454,20 @@ def _authorize_replication_initial( # pylint: disable=inconsistent-return-state
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.AuthorizeRequest",
+ body: _models.AuthorizeRequest,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'AuthorizeRequest')
@@ -2132,11 +2481,13 @@ def _authorize_replication_initial( # pylint: disable=inconsistent-return-state
content_type=content_type,
json=_json,
template_url=self._authorize_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2160,7 +2511,7 @@ def begin_authorize_replication( # pylint: disable=inconsistent-return-statemen
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.AuthorizeRequest",
+ body: _models.AuthorizeRequest,
**kwargs: Any
) -> LROPoller[None]:
"""Authorize source volume replication.
@@ -2189,17 +2540,20 @@ def begin_authorize_replication( # pylint: disable=inconsistent-return-statemen
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._authorize_replication_initial(
+ raw_result = self._authorize_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -2208,6 +2562,8 @@ def begin_authorize_replication( # pylint: disable=inconsistent-return-statemen
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2217,8 +2573,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2239,13 +2601,16 @@ def _re_initialize_replication_initial( # pylint: disable=inconsistent-return-s
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_re_initialize_replication_request_initial(
@@ -2256,11 +2621,13 @@ def _re_initialize_replication_initial( # pylint: disable=inconsistent-return-s
volume_name=volume_name,
api_version=api_version,
template_url=self._re_initialize_replication_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2310,22 +2677,27 @@ def begin_re_initialize_replication( # pylint: disable=inconsistent-return-stat
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._re_initialize_replication_initial(
+ raw_result = self._re_initialize_replication_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2335,8 +2707,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2355,17 +2733,20 @@ def _pool_change_initial( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.PoolChangeRequest",
+ body: _models.PoolChangeRequest,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
_json = self._serialize.body(body, 'PoolChangeRequest')
@@ -2379,11 +2760,13 @@ def _pool_change_initial( # pylint: disable=inconsistent-return-statements
content_type=content_type,
json=_json,
template_url=self._pool_change_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2407,7 +2790,7 @@ def begin_pool_change( # pylint: disable=inconsistent-return-statements
account_name: str,
pool_name: str,
volume_name: str,
- body: "_models.PoolChangeRequest",
+ body: _models.PoolChangeRequest,
**kwargs: Any
) -> LROPoller[None]:
"""Change pool for volume.
@@ -2436,17 +2819,20 @@ def begin_pool_change( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._pool_change_initial(
+ raw_result = self._pool_change_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
@@ -2455,6 +2841,8 @@ def begin_pool_change( # pylint: disable=inconsistent-return-statements
api_version=api_version,
content_type=content_type,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2464,8 +2852,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+ lro_options={'final-state-via': 'location'},
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2486,13 +2880,16 @@ def _relocate_initial( # pylint: disable=inconsistent-return-statements
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_relocate_request_initial(
@@ -2503,11 +2900,13 @@ def _relocate_initial( # pylint: disable=inconsistent-return-statements
volume_name=volume_name,
api_version=api_version,
template_url=self._relocate_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2557,22 +2956,27 @@ def begin_relocate( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._relocate_initial(
+ raw_result = self._relocate_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2582,8 +2986,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2604,13 +3014,16 @@ def _finalize_relocation_initial( # pylint: disable=inconsistent-return-stateme
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_finalize_relocation_request_initial(
@@ -2621,11 +3034,13 @@ def _finalize_relocation_initial( # pylint: disable=inconsistent-return-stateme
volume_name=volume_name,
api_version=api_version,
template_url=self._finalize_relocation_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2675,22 +3090,27 @@ def begin_finalize_relocation( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._finalize_relocation_initial(
+ raw_result = self._finalize_relocation_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2700,8 +3120,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
@@ -2722,13 +3148,16 @@ def _revert_relocation_initial( # pylint: disable=inconsistent-return-statement
volume_name: str,
**kwargs: Any
) -> None:
- cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
- error_map.update(kwargs.pop('error_map', {}))
+ error_map.update(kwargs.pop('error_map', {}) or {})
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
+ cls = kwargs.pop('cls', None) # type: ClsType[None]
request = build_revert_relocation_request_initial(
@@ -2739,11 +3168,13 @@ def _revert_relocation_initial( # pylint: disable=inconsistent-return-statement
volume_name=volume_name,
api_version=api_version,
template_url=self._revert_relocation_initial.metadata['url'],
+ headers=_headers,
+ params=_params,
)
request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ request.url = self._client.format_url(request.url) # type: ignore
- pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
+ pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request,
stream=False,
**kwargs
@@ -2794,22 +3225,27 @@ def begin_revert_relocation( # pylint: disable=inconsistent-return-statements
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
"""
- api_version = kwargs.pop('api_version', "2022-01-01") # type: str
- polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-03-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[None]
+ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
- raw_result = self._revert_relocation_initial(
+ raw_result = self._revert_relocation_initial( # type: ignore
resource_group_name=resource_group_name,
account_name=account_name,
pool_name=pool_name,
volume_name=volume_name,
api_version=api_version,
cls=lambda x,y,z: x,
+ headers=_headers,
+ params=_params,
**kwargs
)
kwargs.pop('error_map', None)
@@ -2819,8 +3255,14 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})
- if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
- elif polling is False: polling_method = NoPolling()
+ if polling is True:
+ polling_method = cast(PollingMethod, ARMPolling(
+ lro_delay,
+
+
+ **kwargs
+ )) # type: PollingMethod
+ elif polling is False: polling_method = cast(PollingMethod, NoPolling())
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(