# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, 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 ...operations._operations import (
    build_storage_accounts_check_name_availability_request,
    build_storage_accounts_create_request,
    build_storage_accounts_delete_request,
    build_storage_accounts_get_properties_request,
    build_storage_accounts_list_by_resource_group_request,
    build_storage_accounts_list_keys_request,
    build_storage_accounts_list_request,
    build_storage_accounts_regenerate_key_request,
    build_storage_accounts_update_request,
    build_usage_list_request,
)

if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping  # type: ignore  # pylint: disable=ungrouped-imports
JSON = MutableMapping[str, Any]  # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class StorageAccountsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`storage_accounts` attribute.
    """

    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")

    @overload
    async def check_name_availability(
        self, account_name: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(
        self, account_name: IO, *, content_type: str = "application/json", **kwargs: Any
    ) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO], **kwargs: Any) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name

        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    async def _create_initial(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> Optional[JSON]:
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters

        request = build_storage_accounts_create_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    @overload
    async def begin_create(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
        lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
        cont_token: Optional[str] = kwargs.pop("continuation_token", None)
        if cont_token is None:
            raw_result = await self._create_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                parameters=parameters,
                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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})  # type: ignore
            return deserialized

        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
        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)  # type: ignore

    @distributed_trace_async
    async def delete(  # pylint: disable=inconsistent-return-statements
        self, resource_group_name: str, account_name: str, **kwargs: Any
    ) -> None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_storage_accounts_delete_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name: str, **kwargs: Any) -> JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @overload
    async def update(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters

        request = build_storage_accounts_update_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -> JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_storage_accounts_list_keys_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) -> AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        def prepare_request(next_link=None):
            if not next_link:

                request = build_storage_accounts_list_request(
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version,
                    headers=_headers,
                    params=_params,
                )
                request.url = self._client.format_url(request.url)

            else:
                # make call to next link with the client's api-version
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict(
                    {
                        key: [urllib.parse.quote(v) for v in value]
                        for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
                    }
                )
                _next_request_params["api-version"] = self._config.api_version
                request = HttpRequest(
                    "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
                )
                request.url = self._client.format_url(request.url)

            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized["value"]
            if cls:
                list_of_elem = cls(list_of_elem)  # type: ignore
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            _stream = False
            pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
                request, stream=_stream, **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                if _stream:
                    await response.read()  # Load the body in memory and close the socket
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        def prepare_request(next_link=None):
            if not next_link:

                request = build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version,
                    headers=_headers,
                    params=_params,
                )
                request.url = self._client.format_url(request.url)

            else:
                # make call to next link with the client's api-version
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict(
                    {
                        key: [urllib.parse.quote(v) for v in value]
                        for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
                    }
                )
                _next_request_params["api-version"] = self._config.api_version
                request = HttpRequest(
                    "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
                )
                request.url = self._client.format_url(request.url)

            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized["value"]
            if cls:
                list_of_elem = cls(list_of_elem)  # type: ignore
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            _stream = False
            pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
                request, stream=_stream, **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                if _stream:
                    await response.read()  # Load the body in memory and close the socket
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(
        self,
        resource_group_name: str,
        account_name: str,
        regenerate_key: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(
        self,
        resource_group_name: str,
        account_name: str,
        regenerate_key: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(
        self, resource_group_name: str, account_name: str, regenerate_key: Union[JSON, IO], **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key

        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) -> JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_usage_list_request(
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

dacd80b41615ad05d71b237797badd70776f773b
<mask token>


class StorageAccountsOperations:
    <mask token>

    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')

    @overload
    async def check_name_availability(self, account_name: JSON, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(self, account_name: IO, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO],
        **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name
        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    async def _create_initial(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->Optional[JSON]:
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[Optional[JSON]] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_create_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: JSON, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: IO, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->AsyncLROPoller[JSON
        ]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
        lro_delay = kwargs.pop('polling_interval', self._config.
            polling_interval)
        cont_token: Optional[str] = kwargs.pop('continuation_token', None)
        if cont_token is None:
            raw_result = await self._create_initial(resource_group_name=
                resource_group_name, account_name=account_name, parameters=
                parameters, 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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized
        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod,
                AsyncARMPolling(lro_delay, **kwargs))
        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)

    @distributed_trace_async
    async def delete(self, resource_group_name: str, account_name: str, **
        kwargs: Any) ->None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[None] = kwargs.pop('cls', None)
        request = build_storage_accounts_delete_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name:
        str, **kwargs: Any) ->JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            api_version=self._config.api_version, headers=_headers, params=
            _params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: JSON, *, content_type: str='application/json', **kwargs:
        Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: IO, *, content_type: str='application/json', **kwargs: Any
        ) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(self, resource_group_name: str, account_name: str,
        parameters: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_update_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str,
        **kwargs: Any) ->JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_list_keys_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = build_storage_accounts_list_request(subscription_id
                    =self._config.subscription_id, api_version=self._config
                    .api_version, headers=_headers, params=_params)
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any
        ) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = (
                    build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version, headers=_headers,
                    params=_params))
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: JSON, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: IO, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key
        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            content_type=content_type, api_version=self._config.api_version,
            json=_json, content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) ->JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_usage_list_request(subscription_id=self._config.
            subscription_id, api_version=self._config.api_version, headers=
            _headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

<mask token>
if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping
<mask token>


class StorageAccountsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`storage_accounts` attribute.
    """

    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')

    @overload
    async def check_name_availability(self, account_name: JSON, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(self, account_name: IO, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO],
        **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name
        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    async def _create_initial(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->Optional[JSON]:
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[Optional[JSON]] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_create_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: JSON, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: IO, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->AsyncLROPoller[JSON
        ]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
        lro_delay = kwargs.pop('polling_interval', self._config.
            polling_interval)
        cont_token: Optional[str] = kwargs.pop('continuation_token', None)
        if cont_token is None:
            raw_result = await self._create_initial(resource_group_name=
                resource_group_name, account_name=account_name, parameters=
                parameters, 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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized
        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod,
                AsyncARMPolling(lro_delay, **kwargs))
        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)

    @distributed_trace_async
    async def delete(self, resource_group_name: str, account_name: str, **
        kwargs: Any) ->None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[None] = kwargs.pop('cls', None)
        request = build_storage_accounts_delete_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name:
        str, **kwargs: Any) ->JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            api_version=self._config.api_version, headers=_headers, params=
            _params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: JSON, *, content_type: str='application/json', **kwargs:
        Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: IO, *, content_type: str='application/json', **kwargs: Any
        ) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(self, resource_group_name: str, account_name: str,
        parameters: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_update_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str,
        **kwargs: Any) ->JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_list_keys_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = build_storage_accounts_list_request(subscription_id
                    =self._config.subscription_id, api_version=self._config
                    .api_version, headers=_headers, params=_params)
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any
        ) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = (
                    build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version, headers=_headers,
                    params=_params))
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: JSON, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: IO, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key
        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            content_type=content_type, api_version=self._config.api_version,
            json=_json, content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) ->JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_usage_list_request(subscription_id=self._config.
            subscription_id, api_version=self._config.api_version, headers=
            _headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

<mask token>
if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping
JSON = MutableMapping[str, Any]
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest,
    AsyncHttpResponse], T, Dict[str, Any]], Any]]


class StorageAccountsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`storage_accounts` attribute.
    """

    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')

    @overload
    async def check_name_availability(self, account_name: JSON, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(self, account_name: IO, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO],
        **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name
        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    async def _create_initial(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->Optional[JSON]:
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[Optional[JSON]] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_create_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: JSON, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: IO, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->AsyncLROPoller[JSON
        ]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
        lro_delay = kwargs.pop('polling_interval', self._config.
            polling_interval)
        cont_token: Optional[str] = kwargs.pop('continuation_token', None)
        if cont_token is None:
            raw_result = await self._create_initial(resource_group_name=
                resource_group_name, account_name=account_name, parameters=
                parameters, 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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized
        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod,
                AsyncARMPolling(lro_delay, **kwargs))
        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)

    @distributed_trace_async
    async def delete(self, resource_group_name: str, account_name: str, **
        kwargs: Any) ->None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[None] = kwargs.pop('cls', None)
        request = build_storage_accounts_delete_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name:
        str, **kwargs: Any) ->JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            api_version=self._config.api_version, headers=_headers, params=
            _params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: JSON, *, content_type: str='application/json', **kwargs:
        Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: IO, *, content_type: str='application/json', **kwargs: Any
        ) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(self, resource_group_name: str, account_name: str,
        parameters: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_update_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str,
        **kwargs: Any) ->JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_list_keys_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = build_storage_accounts_list_request(subscription_id
                    =self._config.subscription_id, api_version=self._config
                    .api_version, headers=_headers, params=_params)
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any
        ) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = (
                    build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version, headers=_headers,
                    params=_params))
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: JSON, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: IO, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key
        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            content_type=content_type, api_version=self._config.api_version,
            json=_json, content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) ->JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_usage_list_request(subscription_id=self._config.
            subscription_id, api_version=self._config.api_version, headers=
            _headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, 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 ...operations._operations import build_storage_accounts_check_name_availability_request, build_storage_accounts_create_request, build_storage_accounts_delete_request, build_storage_accounts_get_properties_request, build_storage_accounts_list_by_resource_group_request, build_storage_accounts_list_keys_request, build_storage_accounts_list_request, build_storage_accounts_regenerate_key_request, build_storage_accounts_update_request, build_usage_list_request
if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping
JSON = MutableMapping[str, Any]
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest,
    AsyncHttpResponse], T, Dict[str, Any]], Any]]


class StorageAccountsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`storage_accounts` attribute.
    """

    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')

    @overload
    async def check_name_availability(self, account_name: JSON, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(self, account_name: IO, *,
        content_type: str='application/json', **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO],
        **kwargs: Any) ->JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name
        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    async def _create_initial(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->Optional[JSON]:
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[Optional[JSON]] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_create_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
        if cls:
            return cls(pipeline_response, deserialized, {})
        return deserialized

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: JSON, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: IO, *, content_type: str='application/json', **
        kwargs: Any) ->AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(self, resource_group_name: str, account_name:
        str, parameters: Union[JSON, IO], **kwargs: Any) ->AsyncLROPoller[JSON
        ]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
        lro_delay = kwargs.pop('polling_interval', self._config.
            polling_interval)
        cont_token: Optional[str] = kwargs.pop('continuation_token', None)
        if cont_token is None:
            raw_result = await self._create_initial(resource_group_name=
                resource_group_name, account_name=account_name, parameters=
                parameters, 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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized
        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod,
                AsyncARMPolling(lro_delay, **kwargs))
        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)

    @distributed_trace_async
    async def delete(self, resource_group_name: str, account_name: str, **
        kwargs: Any) ->None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[None] = kwargs.pop('cls', None)
        request = build_storage_accounts_delete_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name:
        str, **kwargs: Any) ->JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            api_version=self._config.api_version, headers=_headers, params=
            _params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: JSON, *, content_type: str='application/json', **kwargs:
        Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(self, resource_group_name: str, account_name: str,
        parameters: IO, *, content_type: str='application/json', **kwargs: Any
        ) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(self, resource_group_name: str, account_name: str,
        parameters: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters
        request = build_storage_accounts_update_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, content_type=
            content_type, api_version=self._config.api_version, json=_json,
            content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str,
        **kwargs: Any) ->JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_storage_accounts_list_keys_request(resource_group_name
            =resource_group_name, account_name=account_name,
            subscription_id=self._config.subscription_id, api_version=self.
            _config.api_version, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = build_storage_accounts_list_request(subscription_id
                    =self._config.subscription_id, api_version=self._config
                    .api_version, headers=_headers, params=_params)
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any
        ) ->AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})

        def prepare_request(next_link=None):
            if not next_link:
                request = (
                    build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version, headers=_headers,
                    params=_params))
                request.url = self._client.format_url(request.url)
            else:
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict({key: [urllib.
                    parse.quote(v) for v in value] for key, value in urllib
                    .parse.parse_qs(_parsed_next_link.query).items()})
                _next_request_params['api-version'] = self._config.api_version
                request = HttpRequest('GET', urllib.parse.urljoin(next_link,
                    _parsed_next_link.path), params=_next_request_params)
                request.url = self._client.format_url(request.url)
            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized['value']
            if cls:
                list_of_elem = cls(list_of_elem)
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)
            _stream = False
            pipeline_response: PipelineResponse = (await self._client.
                _pipeline.run(request, stream=_stream, **kwargs))
            response = pipeline_response.http_response
            if response.status_code not in [200]:
                if _stream:
                    await response.read()
                map_error(status_code=response.status_code, response=
                    response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=
                    ARMErrorFormat)
            return pipeline_response
        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: JSON, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: IO, *, content_type: str='application/json',
        **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(self, resource_group_name: str, account_name:
        str, regenerate_key: Union[JSON, IO], **kwargs: Any) ->JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = case_insensitive_dict(kwargs.pop('headers', {}) or {})
        _params = kwargs.pop('params', {}) or {}
        content_type: Optional[str] = kwargs.pop('content_type', _headers.
            pop('Content-Type', None))
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        content_type = content_type or 'application/json'
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key
        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name, account_name=
            account_name, subscription_id=self._config.subscription_id,
            content_type=content_type, api_version=self._config.api_version,
            json=_json, content=_content, headers=_headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) ->JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {(401): ClientAuthenticationError, (404):
            ResourceNotFoundError, (409): ResourceExistsError, (304):
            ResourceNotModifiedError}
        error_map.update(kwargs.pop('error_map', {}) or {})
        _headers = kwargs.pop('headers', {}) or {}
        _params = kwargs.pop('params', {}) or {}
        cls: ClsType[JSON] = kwargs.pop('cls', None)
        request = build_usage_list_request(subscription_id=self._config.
            subscription_id, api_version=self._config.api_version, headers=
            _headers, params=_params)
        request.url = self._client.format_url(request.url)
        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(
            request, stream=_stream, **kwargs)
        response = pipeline_response.http_response
        if response.status_code not in [200]:
            if _stream:
                await response.read()
            map_error(status_code=response.status_code, response=response,
                error_map=error_map)
            raise HttpResponseError(response=response, error_format=
                ARMErrorFormat)
        if response.content:
            deserialized = response.json()
        else:
            deserialized = None
        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})
        return cast(JSON, deserialized)

# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import AsyncHttpResponse, 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 ...operations._operations import (
    build_storage_accounts_check_name_availability_request,
    build_storage_accounts_create_request,
    build_storage_accounts_delete_request,
    build_storage_accounts_get_properties_request,
    build_storage_accounts_list_by_resource_group_request,
    build_storage_accounts_list_keys_request,
    build_storage_accounts_list_request,
    build_storage_accounts_regenerate_key_request,
    build_storage_accounts_update_request,
    build_usage_list_request,
)

if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping  # type: ignore  # pylint: disable=ungrouped-imports
JSON = MutableMapping[str, Any]  # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class StorageAccountsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`storage_accounts` attribute.
    """

    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")

    @overload
    async def check_name_availability(
        self, account_name: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @overload
    async def check_name_availability(
        self, account_name: IO, *, content_type: str = "application/json", **kwargs: Any
    ) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """

    @distributed_trace_async
    async def check_name_availability(self, account_name: Union[JSON, IO], **kwargs: Any) -> JSON:
        """Checks that account name is valid and is not in use.

        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Is either a JSON type or a IO type. Required.
        :type account_name: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                account_name = {
                    "name": "str",  # Required.
                    "type": "Microsoft.Storage/storageAccounts"  # Optional. Default value is
                      "Microsoft.Storage/storageAccounts".
                }

                # response body for status code(s): 200
                response == {
                    "message": "str",  # Optional. Gets an error message explaining the Reason
                      value in more detail.
                    "nameAvailable": bool,  # Optional. Gets a boolean value that indicates
                      whether the name is available for you to use. If true, the name is available. If
                      false, the name has already been taken or invalid and cannot be used.
                    "reason": "str"  # Optional. Gets the reason that a storage account name
                      could not be used. The Reason element is only returned if NameAvailable is false.
                      Known values are: "AccountNameInvalid" and "AlreadyExists".
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(account_name, (IOBase, bytes)):
            _content = account_name
        else:
            _json = account_name

        request = build_storage_accounts_check_name_availability_request(
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    async def _create_initial(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> Optional[JSON]:
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters

        request = build_storage_accounts_create_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 202]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = None
        if response.status_code == 200:
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    @overload
    async def begin_create(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def begin_create(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def begin_create(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> AsyncLROPoller[JSON]:
        """Asynchronously creates a new storage account with the specified parameters. Existing accounts
        cannot be updated with this API and should instead use the Update Storage Account API. If an
        account is already created and subsequent PUT request is issued with exact same set of
        properties, then HTTP 200 would be returned.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to provide for the created account. Is either a JSON type or
         a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :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 JSON object
        :rtype: ~azure.core.polling.AsyncLROPoller[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str"  # Optional. Gets or sets the account type.
                          Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)
        polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
        lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
        cont_token: Optional[str] = kwargs.pop("continuation_token", None)
        if cont_token is None:
            raw_result = await self._create_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                parameters=parameters,
                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
            if response.content:
                deserialized = response.json()
            else:
                deserialized = None
            if cls:
                return cls(pipeline_response, deserialized, {})  # type: ignore
            return deserialized

        if polling is True:
            polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
        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)  # type: ignore

    @distributed_trace_async
    async def delete(  # pylint: disable=inconsistent-return-statements
        self, resource_group_name: str, account_name: str, **kwargs: Any
    ) -> None:
        """Deletes a storage account in Microsoft Azure.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: None
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_storage_accounts_delete_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            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, {})

    @distributed_trace_async
    async def get_properties(self, resource_group_name: str, account_name: str, **kwargs: Any) -> JSON:
        """Returns the properties for the specified storage account including but not limited to name,
        account type, location, and account status. The ListKeys operation should be used to retrieve
        storage keys.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_storage_accounts_get_properties_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @overload
    async def update(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @overload
    async def update(
        self,
        resource_group_name: str,
        account_name: str,
        parameters: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Required.
        :type parameters: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """

    @distributed_trace_async
    async def update(
        self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO], **kwargs: Any
    ) -> JSON:
        """Updates the account type or tags for a storage account. It can also be used to add a custom
        domain (note that custom domains cannot be added via the Create operation). Only one custom
        domain is supported per storage account. This API can only be used to update one of tags,
        accountType, or customDomain per call. To update multiple of these properties, call the API
        multiple times with one change per call. This call does not change the storage keys for the
        account. If you want to change storage account keys, use the RegenerateKey operation. The
        location and name of the storage account cannot be changed after creation.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param parameters: The parameters to update on the account. Note that only one property can be
         changed at a time using this API. Is either a JSON type or a IO type. Required.
        :type parameters: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                parameters = {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets or sets the account type.
                          Note that StandardZRS and PremiumLRS accounts cannot be changed to other
                          account types, and other account types cannot be changed to StandardZRS or
                          PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        }
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(parameters, (IOBase, bytes)):
            _content = parameters
        else:
            _json = parameters

        request = build_storage_accounts_update_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @distributed_trace_async
    async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -> JSON:
        """Lists the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account. Required.
        :type account_name: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_storage_accounts_list_keys_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)

    @distributed_trace
    def list(self, **kwargs: Any) -> AsyncIterable[JSON]:
        """Lists all the storage accounts available under the subscription. Note that storage keys are not
        returned; use the ListKeys operation for this.

        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        def prepare_request(next_link=None):
            if not next_link:

                request = build_storage_accounts_list_request(
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version,
                    headers=_headers,
                    params=_params,
                )
                request.url = self._client.format_url(request.url)

            else:
                # make call to next link with the client's api-version
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict(
                    {
                        key: [urllib.parse.quote(v) for v in value]
                        for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
                    }
                )
                _next_request_params["api-version"] = self._config.api_version
                request = HttpRequest(
                    "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
                )
                request.url = self._client.format_url(request.url)

            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized["value"]
            if cls:
                list_of_elem = cls(list_of_elem)  # type: ignore
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            _stream = False
            pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
                request, stream=_stream, **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                if _stream:
                    await response.read()  # Load the body in memory and close the socket
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(get_next, extract_data)

    @distributed_trace
    def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable[JSON]:
        """Lists all the storage accounts available under the given resource group. Note that storage keys
        are not returned; use the ListKeys operation for this.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :return: An iterator like instance of JSON object
        :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON]
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "location": "str",  # Resource location. Required.
                    "id": "str",  # Optional. Resource Id.
                    "name": "str",  # Optional. Resource name.
                    "properties": {
                        "accountType": "str",  # Optional. Gets the type of the storage
                          account. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS",
                          "Standard_RAGRS", and "Premium_LRS".
                        "creationTime": "2020-02-20 00:00:00",  # Optional. Gets the creation
                          date and time of the storage account in UTC.
                        "customDomain": {
                            "name": "str",  # Optional. Gets or sets the custom domain
                              name. Name is the CNAME source.
                            "useSubDomain": bool  # Optional. Indicates whether indirect
                              CName validation is enabled. Default value is false. This should only be
                              set on updates.
                        },
                        "lastGeoFailoverTime": "2020-02-20 00:00:00",  # Optional. Gets the
                          timestamp of the most recent instance of a failover to the secondary
                          location. Only the most recent timestamp is retained. This element is not
                          returned if there has never been a failover instance. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "primaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "primaryLocation": "str",  # Optional. Gets the location of the
                          primary for the storage account.
                        "provisioningState": "str",  # Optional. Gets the status of the
                          storage account at the time the operation was called. Known values are:
                          "Creating", "ResolvingDNS", and "Succeeded".
                        "secondaryEndpoints": {
                            "FooPoint": {
                                "Bar.Point": {
                                    "RecursivePoint": ...
                                }
                            },
                            "blob": "str",  # Optional. Gets the blob endpoint.
                            "dummyEndPoint": ...,
                            "queue": "str",  # Optional. Gets the queue endpoint.
                            "table": "str"  # Optional. Gets the table endpoint.
                        },
                        "secondaryLocation": "str",  # Optional. Gets the location of the geo
                          replicated secondary for the storage account. Only available if the
                          accountType is StandardGRS or StandardRAGRS.
                        "statusOfPrimary": "str",  # Optional. Gets the status indicating
                          whether the primary location of the storage account is available or
                          unavailable. Known values are: "Available" and "Unavailable".
                        "statusOfSecondary": "str"  # Optional. Gets the status indicating
                          whether the secondary location of the storage account is available or
                          unavailable. Only available if the accountType is StandardGRS or
                          StandardRAGRS. Known values are: "Available" and "Unavailable".
                    },
                    "tags": {
                        "str": "str"  # Optional. Resource tags.
                    },
                    "type": "str"  # Optional. Resource type.
                }
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        def prepare_request(next_link=None):
            if not next_link:

                request = build_storage_accounts_list_by_resource_group_request(
                    resource_group_name=resource_group_name,
                    subscription_id=self._config.subscription_id,
                    api_version=self._config.api_version,
                    headers=_headers,
                    params=_params,
                )
                request.url = self._client.format_url(request.url)

            else:
                # make call to next link with the client's api-version
                _parsed_next_link = urllib.parse.urlparse(next_link)
                _next_request_params = case_insensitive_dict(
                    {
                        key: [urllib.parse.quote(v) for v in value]
                        for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
                    }
                )
                _next_request_params["api-version"] = self._config.api_version
                request = HttpRequest(
                    "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
                )
                request.url = self._client.format_url(request.url)

            return request

        async def extract_data(pipeline_response):
            deserialized = pipeline_response.http_response.json()
            list_of_elem = deserialized["value"]
            if cls:
                list_of_elem = cls(list_of_elem)  # type: ignore
            return None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            _stream = False
            pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
                request, stream=_stream, **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                if _stream:
                    await response.read()  # Load the body in memory and close the socket
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(get_next, extract_data)

    @overload
    async def regenerate_key(
        self,
        resource_group_name: str,
        account_name: str,
        regenerate_key: JSON,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @overload
    async def regenerate_key(
        self,
        resource_group_name: str,
        account_name: str,
        regenerate_key: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Required.
        :type regenerate_key: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Known values are: 'application/json', 'text/json'. Default value is "application/json".
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """

    @distributed_trace_async
    async def regenerate_key(
        self, resource_group_name: str, account_name: str, regenerate_key: Union[JSON, IO], **kwargs: Any
    ) -> JSON:
        """Regenerates the access keys for the specified storage account.

        :param resource_group_name: The name of the resource group within the user’s subscription.
         Required.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and
         lower-case letters only. Required.
        :type account_name: str
        :param regenerate_key: Specifies name of the key which should be regenerated. Is either a JSON
         type or a IO type. Required.
        :type regenerate_key: JSON or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json',
         'text/json'. Default value is None.
        :paramtype content_type: str
        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                regenerate_key = {
                    "keyName": "str"  # Optional. Known values are: "key1" and "key2".
                }

                # response body for status code(s): 200
                response == {
                    "key1": "str",  # Optional. Gets the value of key 1.
                    "key2": "str"  # Optional. Gets the value of key 2.
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = kwargs.pop("params", {}) or {}

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[JSON] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(regenerate_key, (IOBase, bytes)):
            _content = regenerate_key
        else:
            _json = regenerate_key

        request = build_storage_accounts_regenerate_key_request(
            resource_group_name=resource_group_name,
            account_name=account_name,
            subscription_id=self._config.subscription_id,
            content_type=content_type,
            api_version=self._config.api_version,
            json=_json,
            content=_content,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)


class UsageOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~storageversiontolerant.aio.StorageManagementClient`'s
        :attr:`usage` attribute.
    """

    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 list(self, **kwargs: Any) -> JSON:
        """Gets the current usage count and the limit for the resources under the subscription.

        :return: JSON object
        :rtype: JSON
        :raises ~azure.core.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "value": [
                        {
                            "currentValue": 0,  # Optional. Gets the current count of the
                              allocated resources in the subscription.
                            "limit": 0,  # Optional. Gets the maximum count of the
                              resources that can be allocated in the subscription.
                            "name": {
                                "localizedValue": "str",  # Optional. Gets a
                                  localized string describing the resource name.
                                "value": "str"  # Optional. Gets a string describing
                                  the resource name.
                            },
                            "unit": "str"  # Optional. Gets the unit of measurement.
                              Known values are: "Count", "Bytes", "Seconds", "Percent",
                              "CountsPerSecond", and "BytesPerSecond".
                        }
                    ]
                }
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[JSON] = kwargs.pop("cls", None)

        request = build_usage_list_request(
            subscription_id=self._config.subscription_id,
            api_version=self._config.api_version,
            headers=_headers,
            params=_params,
        )
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            if _stream:
                await response.read()  # Load the body in memory and close the socket
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.content:
            deserialized = response.json()
        else:
            deserialized = None

        if cls:
            return cls(pipeline_response, cast(JSON, deserialized), {})

        return cast(JSON, deserialized)
