text: # 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.
  # --------------------------------------------------------------------------
  import datetime
  from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union
  
  from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
  from azure.core.pipeline import PipelineResponse
  from azure.core.pipeline.transport import AsyncHttpResponse
  from azure.core.rest import HttpRequest
  from azure.core.tracing.decorator_async import distributed_trace_async
  from azure.core.utils import case_insensitive_dict
  
  from ... import models as _models
  from ..._vendor import _convert_request
  from ...operations._blob_operations import build_abort_copy_from_url_request, build_acquire_lease_request, build_break_lease_request, build_change_lease_request, build_copy_from_url_request, build_create_snapshot_request, build_delete_immutability_policy_request, build_delete_request, build_download_request, build_get_account_info_request, build_get_properties_request, build_get_tags_request, build_query_request, build_release_lease_request, build_renew_lease_request, build_set_expiry_request, build_set_http_headers_request, build_set_immutability_policy_request, build_set_legal_hold_request, build_set_metadata_request, build_set_tags_request, build_set_tier_request, build_start_copy_from_url_request, build_undelete_request
  T = TypeVar('T')
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
  
  class BlobOperations:  # pylint: disable=too-many-public-methods
      """
      .. warning::
          **DO NOT** instantiate this class directly.
  
          Instead, you should access the following operations through
          :class:`~azure.storage.blob.aio.AzureBlobStorage`'s
          :attr:`blob` attribute.
      """
  
      models = _models
  
      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 download(
          self,
          snapshot: Optional[str] = None,
          version_id: Optional[str] = None,
          timeout: Optional[int] = None,
          range: Optional[str] = None,
          range_get_content_md5: Optional[bool] = None,
          range_get_content_crc64: Optional[bool] = None,
          request_id_parameter: Optional[str] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          cpk_info: Optional[_models.CpkInfo] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> IO:
          """The Download operation reads or downloads a blob from the system, including its metadata and
          properties. You can also call Download to read a snapshot.
  
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param range: Return only the bytes of the blob in the specified range. Default value is None.
          :type range: str
          :param range_get_content_md5: When set to true and specified together with the Range, the
           service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB
           in size. Default value is None.
          :type range_get_content_md5: bool
          :param range_get_content_crc64: When set to true and specified together with the Range, the
           service returns the CRC64 hash for the range, as long as the range is less than or equal to 4
           MB in size. Default value is None.
          :type range_get_content_crc64: bool
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param cpk_info: Parameter group. Default value is None.
          :type cpk_info: ~azure.storage.blob.models.CpkInfo
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IO, or the result of cls(response)
          :rtype: IO
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = kwargs.pop("params", {}) or {}
  
          cls = kwargs.pop('cls', None)  # type: ClsType[IO]
  
          _lease_id = None
          _encryption_key = None
          _encryption_key_sha256 = None
          _encryption_algorithm = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if cpk_info is not None:
              _encryption_key = cpk_info.encryption_key
              _encryption_key_sha256 = cpk_info.encryption_key_sha256
              _encryption_algorithm = cpk_info.encryption_algorithm
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_download_request(
              url=self._config.url,
              version=self._config.version,
              snapshot=snapshot,
              version_id=version_id,
              timeout=timeout,
              range=range,
              lease_id=_lease_id,
              range_get_content_md5=range_get_content_md5,
              range_get_content_crc64=range_get_content_crc64,
              encryption_key=_encryption_key,
              encryption_key_sha256=_encryption_key_sha256,
              encryption_algorithm=_encryption_algorithm,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.download.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=True,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 206]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          if response.status_code == 200:
              response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
              response_headers['x-ms-meta']=self._deserialize('{str}', response.headers.get('x-ms-meta'))
              response_headers['x-ms-or-policy-id']=self._deserialize('str', response.headers.get('x-ms-or-policy-id'))
              response_headers['x-ms-or']=self._deserialize('{str}', response.headers.get('x-ms-or'))
              response_headers['Content-Length']=self._deserialize('long', response.headers.get('Content-Length'))
              response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
              response_headers['Content-Range']=self._deserialize('str', response.headers.get('Content-Range'))
              response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
              response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
              response_headers['Content-Encoding']=self._deserialize('str', response.headers.get('Content-Encoding'))
              response_headers['Cache-Control']=self._deserialize('str', response.headers.get('Cache-Control'))
              response_headers['Content-Disposition']=self._deserialize('str', response.headers.get('Content-Disposition'))
              response_headers['Content-Language']=self._deserialize('str', response.headers.get('Content-Language'))
              response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
              response_headers['x-ms-blob-type']=self._deserialize('str', response.headers.get('x-ms-blob-type'))
              response_headers['x-ms-copy-completion-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time'))
              response_headers['x-ms-copy-status-description']=self._deserialize('str', response.headers.get('x-ms-copy-status-description'))
              response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
              response_headers['x-ms-copy-progress']=self._deserialize('str', response.headers.get('x-ms-copy-progress'))
              response_headers['x-ms-copy-source']=self._deserialize('str', response.headers.get('x-ms-copy-source'))
              response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
              response_headers['x-ms-lease-duration']=self._deserialize('str', response.headers.get('x-ms-lease-duration'))
              response_headers['x-ms-lease-state']=self._deserialize('str', response.headers.get('x-ms-lease-state'))
              response_headers['x-ms-lease-status']=self._deserialize('str', response.headers.get('x-ms-lease-status'))
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
              response_headers['x-ms-is-current-version']=self._deserialize('bool', response.headers.get('x-ms-is-current-version'))
              response_headers['Accept-Ranges']=self._deserialize('str', response.headers.get('Accept-Ranges'))
              response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
              response_headers['x-ms-blob-committed-block-count']=self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count'))
              response_headers['x-ms-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-server-encrypted'))
              response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
              response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
              response_headers['x-ms-blob-content-md5']=self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5'))
              response_headers['x-ms-tag-count']=self._deserialize('long', response.headers.get('x-ms-tag-count'))
              response_headers['x-ms-blob-sealed']=self._deserialize('bool', response.headers.get('x-ms-blob-sealed'))
              response_headers['x-ms-last-access-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-last-access-time'))
              response_headers['x-ms-immutability-policy-until-date']=self._deserialize('rfc-1123', response.headers.get('x-ms-immutability-policy-until-date'))
              response_headers['x-ms-immutability-policy-mode']=self._deserialize('str', response.headers.get('x-ms-immutability-policy-mode'))
              response_headers['x-ms-legal-hold']=self._deserialize('bool', response.headers.get('x-ms-legal-hold'))
              
              deserialized = response.stream_download(self._client._pipeline)
  
          if response.status_code == 206:
              response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
              response_headers['x-ms-meta']=self._deserialize('{str}', response.headers.get('x-ms-meta'))
              response_headers['x-ms-or-policy-id']=self._deserialize('str', response.headers.get('x-ms-or-policy-id'))
              response_headers['x-ms-or']=self._deserialize('{str}', response.headers.get('x-ms-or'))
              response_headers['Content-Length']=self._deserialize('long', response.headers.get('Content-Length'))
              response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
              response_headers['Content-Range']=self._deserialize('str', response.headers.get('Content-Range'))
              response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
              response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
              response_headers['Content-Encoding']=self._deserialize('str', response.headers.get('Content-Encoding'))
              response_headers['Cache-Control']=self._deserialize('str', response.headers.get('Cache-Control'))
              response_headers['Content-Disposition']=self._deserialize('str', response.headers.get('Content-Disposition'))
              response_headers['Content-Language']=self._deserialize('str', response.headers.get('Content-Language'))
              response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
              response_headers['x-ms-blob-type']=self._deserialize('str', response.headers.get('x-ms-blob-type'))
              response_headers['x-ms-content-crc64']=self._deserialize('bytearray', response.headers.get('x-ms-content-crc64'))
              response_headers['x-ms-copy-completion-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time'))
              response_headers['x-ms-copy-status-description']=self._deserialize('str', response.headers.get('x-ms-copy-status-description'))
              response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
              response_headers['x-ms-copy-progress']=self._deserialize('str', response.headers.get('x-ms-copy-progress'))
              response_headers['x-ms-copy-source']=self._deserialize('str', response.headers.get('x-ms-copy-source'))
              response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
              response_headers['x-ms-lease-duration']=self._deserialize('str', response.headers.get('x-ms-lease-duration'))
              response_headers['x-ms-lease-state']=self._deserialize('str', response.headers.get('x-ms-lease-state'))
              response_headers['x-ms-lease-status']=self._deserialize('str', response.headers.get('x-ms-lease-status'))
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
              response_headers['x-ms-is-current-version']=self._deserialize('bool', response.headers.get('x-ms-is-current-version'))
              response_headers['Accept-Ranges']=self._deserialize('str', response.headers.get('Accept-Ranges'))
              response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
              response_headers['x-ms-blob-committed-block-count']=self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count'))
              response_headers['x-ms-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-server-encrypted'))
              response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
              response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
              response_headers['x-ms-blob-content-md5']=self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5'))
              response_headers['x-ms-tag-count']=self._deserialize('long', response.headers.get('x-ms-tag-count'))
              response_headers['x-ms-blob-sealed']=self._deserialize('bool', response.headers.get('x-ms-blob-sealed'))
              response_headers['x-ms-last-access-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-last-access-time'))
              response_headers['x-ms-immutability-policy-until-date']=self._deserialize('rfc-1123', response.headers.get('x-ms-immutability-policy-until-date'))
              response_headers['x-ms-immutability-policy-mode']=self._deserialize('str', response.headers.get('x-ms-immutability-policy-mode'))
              response_headers['x-ms-legal-hold']=self._deserialize('bool', response.headers.get('x-ms-legal-hold'))
              
              deserialized = response.stream_download(self._client._pipeline)
  
          if cls:
              return cls(pipeline_response, deserialized, response_headers)
  
          return deserialized
  
      download.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def get_properties(  # pylint: disable=inconsistent-return-statements
          self,
          snapshot: Optional[str] = None,
          version_id: Optional[str] = None,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          cpk_info: Optional[_models.CpkInfo] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Get Properties operation returns all user-defined metadata, standard HTTP properties, and
          system properties for the blob. It does not return the content of the blob.
  
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param cpk_info: Parameter group. Default value is None.
          :type cpk_info: ~azure.storage.blob.models.CpkInfo
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = kwargs.pop("params", {}) or {}
  
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _lease_id = None
          _encryption_key = None
          _encryption_key_sha256 = None
          _encryption_algorithm = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if cpk_info is not None:
              _encryption_key = cpk_info.encryption_key
              _encryption_key_sha256 = cpk_info.encryption_key_sha256
              _encryption_algorithm = cpk_info.encryption_algorithm
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_get_properties_request(
              url=self._config.url,
              version=self._config.version,
              snapshot=snapshot,
              version_id=version_id,
              timeout=timeout,
              lease_id=_lease_id,
              encryption_key=_encryption_key,
              encryption_key_sha256=_encryption_key_sha256,
              encryption_algorithm=_encryption_algorithm,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.get_properties.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-creation-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-creation-time'))
          response_headers['x-ms-meta']=self._deserialize('{str}', response.headers.get('x-ms-meta'))
          response_headers['x-ms-or-policy-id']=self._deserialize('str', response.headers.get('x-ms-or-policy-id'))
          response_headers['x-ms-or']=self._deserialize('{str}', response.headers.get('x-ms-or'))
          response_headers['x-ms-blob-type']=self._deserialize('str', response.headers.get('x-ms-blob-type'))
          response_headers['x-ms-copy-completion-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time'))
          response_headers['x-ms-copy-status-description']=self._deserialize('str', response.headers.get('x-ms-copy-status-description'))
          response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
          response_headers['x-ms-copy-progress']=self._deserialize('str', response.headers.get('x-ms-copy-progress'))
          response_headers['x-ms-copy-source']=self._deserialize('str', response.headers.get('x-ms-copy-source'))
          response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
          response_headers['x-ms-incremental-copy']=self._deserialize('bool', response.headers.get('x-ms-incremental-copy'))
          response_headers['x-ms-copy-destination-snapshot']=self._deserialize('str', response.headers.get('x-ms-copy-destination-snapshot'))
          response_headers['x-ms-lease-duration']=self._deserialize('str', response.headers.get('x-ms-lease-duration'))
          response_headers['x-ms-lease-state']=self._deserialize('str', response.headers.get('x-ms-lease-state'))
          response_headers['x-ms-lease-status']=self._deserialize('str', response.headers.get('x-ms-lease-status'))
          response_headers['Content-Length']=self._deserialize('long', response.headers.get('Content-Length'))
          response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
          response_headers['Content-Encoding']=self._deserialize('str', response.headers.get('Content-Encoding'))
          response_headers['Content-Disposition']=self._deserialize('str', response.headers.get('Content-Disposition'))
          response_headers['Content-Language']=self._deserialize('str', response.headers.get('Content-Language'))
          response_headers['Cache-Control']=self._deserialize('str', response.headers.get('Cache-Control'))
          response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['Accept-Ranges']=self._deserialize('str', response.headers.get('Accept-Ranges'))
          response_headers['x-ms-blob-committed-block-count']=self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count'))
          response_headers['x-ms-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-server-encrypted'))
          response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
          response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
          response_headers['x-ms-access-tier']=self._deserialize('str', response.headers.get('x-ms-access-tier'))
          response_headers['x-ms-access-tier-inferred']=self._deserialize('bool', response.headers.get('x-ms-access-tier-inferred'))
          response_headers['x-ms-archive-status']=self._deserialize('str', response.headers.get('x-ms-archive-status'))
          response_headers['x-ms-access-tier-change-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-access-tier-change-time'))
          response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
          response_headers['x-ms-is-current-version']=self._deserialize('bool', response.headers.get('x-ms-is-current-version'))
          response_headers['x-ms-tag-count']=self._deserialize('long', response.headers.get('x-ms-tag-count'))
          response_headers['x-ms-expiry-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-expiry-time'))
          response_headers['x-ms-blob-sealed']=self._deserialize('bool', response.headers.get('x-ms-blob-sealed'))
          response_headers['x-ms-rehydrate-priority']=self._deserialize('str', response.headers.get('x-ms-rehydrate-priority'))
          response_headers['x-ms-last-access-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-last-access-time'))
          response_headers['x-ms-immutability-policy-until-date']=self._deserialize('rfc-1123', response.headers.get('x-ms-immutability-policy-until-date'))
          response_headers['x-ms-immutability-policy-mode']=self._deserialize('str', response.headers.get('x-ms-immutability-policy-mode'))
          response_headers['x-ms-legal-hold']=self._deserialize('bool', response.headers.get('x-ms-legal-hold'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      get_properties.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def delete(  # pylint: disable=inconsistent-return-statements
          self,
          snapshot: Optional[str] = None,
          version_id: Optional[str] = None,
          timeout: Optional[int] = None,
          delete_snapshots: Optional[Union[str, "_models.DeleteSnapshotsOptionType"]] = None,
          request_id_parameter: Optional[str] = None,
          blob_delete_type: Optional[str] = "Permanent",
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """If the storage account's soft delete feature is disabled then, when a blob is deleted, it is
          permanently removed from the storage account. If the storage account's soft delete feature is
          enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible
          immediately. However, the blob service retains the blob or snapshot for the number of days
          specified by the DeleteRetentionPolicy section of [Storage service properties]
          (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's
          data is permanently removed from the storage account. Note that you continue to be charged for
          the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and
          specify the "include=deleted" query parameter to discover which blobs and snapshots have been
          soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other
          operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code
          of 404 (ResourceNotFound).
  
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param delete_snapshots: Required if the blob has associated snapshots. Specify one of the
           following two options: include: Delete the base blob and all of its snapshots. only: Delete
           only the blob's snapshots and not the blob itself. Default value is None.
          :type delete_snapshots: str or ~azure.storage.blob.models.DeleteSnapshotsOptionType
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param blob_delete_type: Optional.  Only possible value is 'permanent', which specifies to
           permanently delete a blob if blob soft delete is enabled. Known values are "Permanent" or None.
           Default value is "Permanent".
          :type blob_delete_type: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = kwargs.pop("params", {}) or {}
  
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _lease_id = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_delete_request(
              url=self._config.url,
              version=self._config.version,
              snapshot=snapshot,
              version_id=version_id,
              timeout=timeout,
              lease_id=_lease_id,
              delete_snapshots=delete_snapshots,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              blob_delete_type=blob_delete_type,
              template_url=self.delete.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      delete.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def undelete(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          **kwargs: Any
      ) -> None:
          """Undelete a blob that was previously soft deleted.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :keyword comp: comp. Default value is "undelete". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "undelete"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          
          request = build_undelete_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              template_url=self.undelete.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      undelete.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_expiry(  # pylint: disable=inconsistent-return-statements
          self,
          expiry_options: Union[str, "_models.BlobExpiryOptions"],
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          expires_on: Optional[str] = None,
          **kwargs: Any
      ) -> None:
          """Sets the time a blob will expire and be deleted.
  
          :param expiry_options: Required. Indicates mode of the expiry time.
          :type expiry_options: str or ~azure.storage.blob.models.BlobExpiryOptions
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param expires_on: The time to set the blob to expiry. Default value is None.
          :type expires_on: str
          :keyword comp: comp. Default value is "expiry". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "expiry"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          
          request = build_set_expiry_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              expiry_options=expiry_options,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              expires_on=expires_on,
              template_url=self.set_expiry.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_expiry.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_http_headers(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          blob_http_headers: Optional[_models.BlobHTTPHeaders] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Set HTTP Headers operation sets system properties on the blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param blob_http_headers: Parameter group. Default value is None.
          :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "properties". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "properties"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _blob_cache_control = None
          _blob_content_type = None
          _blob_content_md5 = None
          _blob_content_encoding = None
          _blob_content_language = None
          _lease_id = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          _blob_content_disposition = None
          if blob_http_headers is not None:
              _blob_cache_control = blob_http_headers.blob_cache_control
              _blob_content_type = blob_http_headers.blob_content_type
              _blob_content_md5 = blob_http_headers.blob_content_md5
              _blob_content_encoding = blob_http_headers.blob_content_encoding
              _blob_content_language = blob_http_headers.blob_content_language
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
          if blob_http_headers is not None:
              _blob_content_disposition = blob_http_headers.blob_content_disposition
  
          request = build_set_http_headers_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              blob_cache_control=_blob_cache_control,
              blob_content_type=_blob_content_type,
              blob_content_md5=_blob_content_md5,
              blob_content_encoding=_blob_content_encoding,
              blob_content_language=_blob_content_language,
              lease_id=_lease_id,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              blob_content_disposition=_blob_content_disposition,
              request_id_parameter=request_id_parameter,
              template_url=self.set_http_headers.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_http_headers.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_immutability_policy(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          immutability_policy_expiry: Optional[datetime.datetime] = None,
          immutability_policy_mode: Optional[Union[str, "_models.BlobImmutabilityPolicyMode"]] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Set Immutability Policy operation sets the immutability policy on the blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param immutability_policy_expiry: Specifies the date time when the blobs immutability policy
           is set to expire. Default value is None.
          :type immutability_policy_expiry: ~datetime.datetime
          :param immutability_policy_mode: Specifies the immutability policy mode to set on the blob.
           Default value is None.
          :type immutability_policy_mode: str or ~azure.storage.blob.models.BlobImmutabilityPolicyMode
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "immutabilityPolicies". Note that overriding this default
           value may result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "immutabilityPolicies"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_unmodified_since = None
          if modified_access_conditions is not None:
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
  
          request = build_set_immutability_policy_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              if_unmodified_since=_if_unmodified_since,
              immutability_policy_expiry=immutability_policy_expiry,
              immutability_policy_mode=immutability_policy_mode,
              template_url=self.set_immutability_policy.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-immutability-policy-until-date']=self._deserialize('rfc-1123', response.headers.get('x-ms-immutability-policy-until-date'))
          response_headers['x-ms-immutability-policy-mode']=self._deserialize('str', response.headers.get('x-ms-immutability-policy-mode'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_immutability_policy.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def delete_immutability_policy(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          **kwargs: Any
      ) -> None:
          """The Delete Immutability Policy operation deletes the immutability policy on the blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :keyword comp: comp. Default value is "immutabilityPolicies". Note that overriding this default
           value may result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "immutabilityPolicies"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          
          request = build_delete_immutability_policy_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              template_url=self.delete_immutability_policy.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      delete_immutability_policy.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_legal_hold(  # pylint: disable=inconsistent-return-statements
          self,
          legal_hold: bool,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          **kwargs: Any
      ) -> None:
          """The Set Legal Hold operation sets a legal hold on the blob.
  
          :param legal_hold: Specified if a legal hold should be set on the blob.
          :type legal_hold: bool
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :keyword comp: comp. Default value is "legalhold". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "legalhold"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          
          request = build_set_legal_hold_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              legal_hold=legal_hold,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              template_url=self.set_legal_hold.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-legal-hold']=self._deserialize('bool', response.headers.get('x-ms-legal-hold'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_legal_hold.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_metadata(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          metadata: Optional[Dict[str, str]] = None,
          request_id_parameter: Optional[str] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          cpk_info: Optional[_models.CpkInfo] = None,
          cpk_scope_info: Optional[_models.CpkScopeInfo] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or
          more name-value pairs.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob.
           If no name-value pairs are specified, the operation will copy the metadata from the source blob
           or file to the destination blob. If one or more name-value pairs are specified, the destination
           blob is created with the specified metadata, and metadata is not copied from the source blob or
           file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming
           rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more
           information. Default value is None.
          :type metadata: dict[str, str]
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param cpk_info: Parameter group. Default value is None.
          :type cpk_info: ~azure.storage.blob.models.CpkInfo
          :param cpk_scope_info: Parameter group. Default value is None.
          :type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "metadata". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "metadata"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _lease_id = None
          _encryption_key = None
          _encryption_key_sha256 = None
          _encryption_algorithm = None
          _encryption_scope = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if cpk_info is not None:
              _encryption_key = cpk_info.encryption_key
              _encryption_key_sha256 = cpk_info.encryption_key_sha256
              _encryption_algorithm = cpk_info.encryption_algorithm
          if cpk_scope_info is not None:
              _encryption_scope = cpk_scope_info.encryption_scope
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_set_metadata_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              metadata=metadata,
              lease_id=_lease_id,
              encryption_key=_encryption_key,
              encryption_key_sha256=_encryption_key_sha256,
              encryption_algorithm=_encryption_algorithm,
              encryption_scope=_encryption_scope,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.set_metadata.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-request-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted'))
          response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
          response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_metadata.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def acquire_lease(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          duration: Optional[int] = None,
          proposed_lease_id: Optional[str] = None,
          request_id_parameter: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
          operations.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param duration: Specifies the duration of the lease, in seconds, or negative one (-1) for a
           lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease
           duration cannot be changed using renew or change. Default value is None.
          :type duration: int
          :param proposed_lease_id: Proposed lease ID, in a GUID string format. The Blob service returns
           400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid
           Constructor (String) for a list of valid GUID string formats. Default value is None.
          :type proposed_lease_id: str
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "lease". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword action: Describes what lease action to take. Default value is "acquire". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype action: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "lease"))  # type: str
          action = kwargs.pop('action', _headers.pop('x-ms-lease-action', "acquire"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_acquire_lease_request(
              url=self._config.url,
              comp=comp,
              action=action,
              version=self._config.version,
              timeout=timeout,
              duration=duration,
              proposed_lease_id=proposed_lease_id,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.acquire_lease.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [201]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-lease-id']=self._deserialize('str', response.headers.get('x-ms-lease-id'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      acquire_lease.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def release_lease(  # pylint: disable=inconsistent-return-statements
          self,
          lease_id: str,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
          operations.
  
          :param lease_id: Specifies the current lease ID on the resource.
          :type lease_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "lease". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword action: Describes what lease action to take. Default value is "release". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype action: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "lease"))  # type: str
          action = kwargs.pop('action', _headers.pop('x-ms-lease-action', "release"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_release_lease_request(
              url=self._config.url,
              comp=comp,
              action=action,
              version=self._config.version,
              lease_id=lease_id,
              timeout=timeout,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.release_lease.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      release_lease.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def renew_lease(  # pylint: disable=inconsistent-return-statements
          self,
          lease_id: str,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
          operations.
  
          :param lease_id: Specifies the current lease ID on the resource.
          :type lease_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "lease". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword action: Describes what lease action to take. Default value is "renew". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype action: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "lease"))  # type: str
          action = kwargs.pop('action', _headers.pop('x-ms-lease-action', "renew"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_renew_lease_request(
              url=self._config.url,
              comp=comp,
              action=action,
              version=self._config.version,
              lease_id=lease_id,
              timeout=timeout,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.renew_lease.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-lease-id']=self._deserialize('str', response.headers.get('x-ms-lease-id'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      renew_lease.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def change_lease(  # pylint: disable=inconsistent-return-statements
          self,
          lease_id: str,
          proposed_lease_id: str,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
          operations.
  
          :param lease_id: Specifies the current lease ID on the resource.
          :type lease_id: str
          :param proposed_lease_id: Proposed lease ID, in a GUID string format. The Blob service returns
           400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid
           Constructor (String) for a list of valid GUID string formats.
          :type proposed_lease_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "lease". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword action: Describes what lease action to take. Default value is "change". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype action: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "lease"))  # type: str
          action = kwargs.pop('action', _headers.pop('x-ms-lease-action', "change"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_change_lease_request(
              url=self._config.url,
              comp=comp,
              action=action,
              version=self._config.version,
              lease_id=lease_id,
              proposed_lease_id=proposed_lease_id,
              timeout=timeout,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.change_lease.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-lease-id']=self._deserialize('str', response.headers.get('x-ms-lease-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      change_lease.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def break_lease(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          break_period: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
          operations.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param break_period: For a break operation, proposed duration the lease should continue before
           it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter
           than the time remaining on the lease. If longer, the time remaining on the lease is used. A new
           lease will not be available before the break period has expired, but the lease may be held for
           longer than the break period. If this header does not appear with a break operation, a
           fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease
           breaks immediately. Default value is None.
          :type break_period: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "lease". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword action: Describes what lease action to take. Default value is "break". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype action: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "lease"))  # type: str
          action = kwargs.pop('action', _headers.pop('x-ms-lease-action', "break"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
  
          request = build_break_lease_request(
              url=self._config.url,
              comp=comp,
              action=action,
              version=self._config.version,
              timeout=timeout,
              break_period=break_period,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.break_lease.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-lease-time']=self._deserialize('int', response.headers.get('x-ms-lease-time'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      break_lease.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def create_snapshot(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          metadata: Optional[Dict[str, str]] = None,
          request_id_parameter: Optional[str] = None,
          cpk_info: Optional[_models.CpkInfo] = None,
          cpk_scope_info: Optional[_models.CpkScopeInfo] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Create Snapshot operation creates a read-only snapshot of a blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob.
           If no name-value pairs are specified, the operation will copy the metadata from the source blob
           or file to the destination blob. If one or more name-value pairs are specified, the destination
           blob is created with the specified metadata, and metadata is not copied from the source blob or
           file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming
           rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more
           information. Default value is None.
          :type metadata: dict[str, str]
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param cpk_info: Parameter group. Default value is None.
          :type cpk_info: ~azure.storage.blob.models.CpkInfo
          :param cpk_scope_info: Parameter group. Default value is None.
          :type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :keyword comp: comp. Default value is "snapshot". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "snapshot"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _encryption_key = None
          _encryption_key_sha256 = None
          _encryption_algorithm = None
          _encryption_scope = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          _lease_id = None
          if cpk_info is not None:
              _encryption_key = cpk_info.encryption_key
              _encryption_key_sha256 = cpk_info.encryption_key_sha256
              _encryption_algorithm = cpk_info.encryption_algorithm
          if cpk_scope_info is not None:
              _encryption_scope = cpk_scope_info.encryption_scope
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
  
          request = build_create_snapshot_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              metadata=metadata,
              encryption_key=_encryption_key,
              encryption_key_sha256=_encryption_key_sha256,
              encryption_algorithm=_encryption_algorithm,
              encryption_scope=_encryption_scope,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              lease_id=_lease_id,
              request_id_parameter=request_id_parameter,
              template_url=self.create_snapshot.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [201]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-snapshot']=self._deserialize('str', response.headers.get('x-ms-snapshot'))
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-request-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      create_snapshot.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def start_copy_from_url(  # pylint: disable=inconsistent-return-statements
          self,
          copy_source: str,
          timeout: Optional[int] = None,
          metadata: Optional[Dict[str, str]] = None,
          tier: Optional[Union[str, "_models.AccessTierOptional"]] = None,
          rehydrate_priority: Optional[Union[str, "_models.RehydratePriority"]] = None,
          request_id_parameter: Optional[str] = None,
          blob_tags_string: Optional[str] = None,
          seal_blob: Optional[bool] = None,
          immutability_policy_expiry: Optional[datetime.datetime] = None,
          immutability_policy_mode: Optional[Union[str, "_models.BlobImmutabilityPolicyMode"]] = None,
          legal_hold: Optional[bool] = None,
          source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Start Copy From URL operation copies a blob or an internet resource to a new blob.
  
          :param copy_source: Specifies the name of the source page blob snapshot. This value is a URL of
           up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it
           would appear in a request URI. The source blob must either be public or must be authenticated
           via a shared access signature.
          :type copy_source: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob.
           If no name-value pairs are specified, the operation will copy the metadata from the source blob
           or file to the destination blob. If one or more name-value pairs are specified, the destination
           blob is created with the specified metadata, and metadata is not copied from the source blob or
           file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming
           rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more
           information. Default value is None.
          :type metadata: dict[str, str]
          :param tier: Optional. Indicates the tier to be set on the blob. Default value is None.
          :type tier: str or ~azure.storage.blob.models.AccessTierOptional
          :param rehydrate_priority: Optional: Indicates the priority with which to rehydrate an archived
           blob. Default value is None.
          :type rehydrate_priority: str or ~azure.storage.blob.models.RehydratePriority
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param blob_tags_string: Optional.  Used to set blob tags in various blob operations. Default
           value is None.
          :type blob_tags_string: str
          :param seal_blob: Overrides the sealed state of the destination blob.  Service version
           2019-12-12 and newer. Default value is None.
          :type seal_blob: bool
          :param immutability_policy_expiry: Specifies the date time when the blobs immutability policy
           is set to expire. Default value is None.
          :type immutability_policy_expiry: ~datetime.datetime
          :param immutability_policy_mode: Specifies the immutability policy mode to set on the blob.
           Default value is None.
          :type immutability_policy_mode: str or ~azure.storage.blob.models.BlobImmutabilityPolicyMode
          :param legal_hold: Specified if a legal hold should be set on the blob. Default value is None.
          :type legal_hold: bool
          :param source_modified_access_conditions: Parameter group. Default value is None.
          :type source_modified_access_conditions:
           ~azure.storage.blob.models.SourceModifiedAccessConditions
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = kwargs.pop("params", {}) or {}
  
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _source_if_modified_since = None
          _source_if_unmodified_since = None
          _source_if_match = None
          _source_if_none_match = None
          _source_if_tags = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          _lease_id = None
          if source_modified_access_conditions is not None:
              _source_if_modified_since = source_modified_access_conditions.source_if_modified_since
              _source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since
              _source_if_match = source_modified_access_conditions.source_if_match
              _source_if_none_match = source_modified_access_conditions.source_if_none_match
              _source_if_tags = source_modified_access_conditions.source_if_tags
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
  
          request = build_start_copy_from_url_request(
              url=self._config.url,
              version=self._config.version,
              copy_source=copy_source,
              timeout=timeout,
              metadata=metadata,
              tier=tier,
              rehydrate_priority=rehydrate_priority,
              source_if_modified_since=_source_if_modified_since,
              source_if_unmodified_since=_source_if_unmodified_since,
              source_if_match=_source_if_match,
              source_if_none_match=_source_if_none_match,
              source_if_tags=_source_if_tags,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              lease_id=_lease_id,
              request_id_parameter=request_id_parameter,
              blob_tags_string=blob_tags_string,
              seal_blob=seal_blob,
              immutability_policy_expiry=immutability_policy_expiry,
              immutability_policy_mode=immutability_policy_mode,
              legal_hold=legal_hold,
              template_url=self.start_copy_from_url.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
          response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      start_copy_from_url.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def copy_from_url(  # pylint: disable=inconsistent-return-statements
          self,
          copy_source: str,
          timeout: Optional[int] = None,
          metadata: Optional[Dict[str, str]] = None,
          tier: Optional[Union[str, "_models.AccessTierOptional"]] = None,
          request_id_parameter: Optional[str] = None,
          source_content_md5: Optional[bytearray] = None,
          blob_tags_string: Optional[str] = None,
          immutability_policy_expiry: Optional[datetime.datetime] = None,
          immutability_policy_mode: Optional[Union[str, "_models.BlobImmutabilityPolicyMode"]] = None,
          legal_hold: Optional[bool] = None,
          copy_source_authorization: Optional[str] = None,
          copy_source_tags: Optional[Union[str, "_models.BlobCopySourceTags"]] = None,
          source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          cpk_scope_info: Optional[_models.CpkScopeInfo] = None,
          **kwargs: Any
      ) -> None:
          """The Copy From URL operation copies a blob or an internet resource to a new blob. It will not
          return a response until the copy is complete.
  
          :param copy_source: Specifies the name of the source page blob snapshot. This value is a URL of
           up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it
           would appear in a request URI. The source blob must either be public or must be authenticated
           via a shared access signature.
          :type copy_source: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob.
           If no name-value pairs are specified, the operation will copy the metadata from the source blob
           or file to the destination blob. If one or more name-value pairs are specified, the destination
           blob is created with the specified metadata, and metadata is not copied from the source blob or
           file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming
           rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more
           information. Default value is None.
          :type metadata: dict[str, str]
          :param tier: Optional. Indicates the tier to be set on the blob. Default value is None.
          :type tier: str or ~azure.storage.blob.models.AccessTierOptional
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param source_content_md5: Specify the md5 calculated for the range of bytes that must be read
           from the copy source. Default value is None.
          :type source_content_md5: bytearray
          :param blob_tags_string: Optional.  Used to set blob tags in various blob operations. Default
           value is None.
          :type blob_tags_string: str
          :param immutability_policy_expiry: Specifies the date time when the blobs immutability policy
           is set to expire. Default value is None.
          :type immutability_policy_expiry: ~datetime.datetime
          :param immutability_policy_mode: Specifies the immutability policy mode to set on the blob.
           Default value is None.
          :type immutability_policy_mode: str or ~azure.storage.blob.models.BlobImmutabilityPolicyMode
          :param legal_hold: Specified if a legal hold should be set on the blob. Default value is None.
          :type legal_hold: bool
          :param copy_source_authorization: Only Bearer type is supported. Credentials should be a valid
           OAuth access token to copy source. Default value is None.
          :type copy_source_authorization: str
          :param copy_source_tags: Optional, default 'replace'.  Indicates if source tags should be
           copied or replaced with the tags specified by x-ms-tags. Default value is None.
          :type copy_source_tags: str or ~azure.storage.blob.models.BlobCopySourceTags
          :param source_modified_access_conditions: Parameter group. Default value is None.
          :type source_modified_access_conditions:
           ~azure.storage.blob.models.SourceModifiedAccessConditions
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param cpk_scope_info: Parameter group. Default value is None.
          :type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
          :keyword x_ms_requires_sync: This header indicates that this is a synchronous Copy Blob From
           URL instead of a Asynchronous Copy Blob. Default value is "true". Note that overriding this
           default value may result in unsupported behavior.
          :paramtype x_ms_requires_sync: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = kwargs.pop("params", {}) or {}
  
          x_ms_requires_sync = kwargs.pop('x_ms_requires_sync', _headers.pop('x-ms-requires-sync', "true"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _source_if_modified_since = None
          _source_if_unmodified_since = None
          _source_if_match = None
          _source_if_none_match = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          _lease_id = None
          _encryption_scope = None
          if source_modified_access_conditions is not None:
              _source_if_modified_since = source_modified_access_conditions.source_if_modified_since
              _source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since
              _source_if_match = source_modified_access_conditions.source_if_match
              _source_if_none_match = source_modified_access_conditions.source_if_none_match
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if cpk_scope_info is not None:
              _encryption_scope = cpk_scope_info.encryption_scope
  
          request = build_copy_from_url_request(
              url=self._config.url,
              x_ms_requires_sync=x_ms_requires_sync,
              version=self._config.version,
              copy_source=copy_source,
              timeout=timeout,
              metadata=metadata,
              tier=tier,
              source_if_modified_since=_source_if_modified_since,
              source_if_unmodified_since=_source_if_unmodified_since,
              source_if_match=_source_if_match,
              source_if_none_match=_source_if_none_match,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              lease_id=_lease_id,
              request_id_parameter=request_id_parameter,
              source_content_md5=source_content_md5,
              blob_tags_string=blob_tags_string,
              immutability_policy_expiry=immutability_policy_expiry,
              immutability_policy_mode=immutability_policy_mode,
              legal_hold=legal_hold,
              copy_source_authorization=copy_source_authorization,
              encryption_scope=_encryption_scope,
              copy_source_tags=copy_source_tags,
              template_url=self.copy_from_url.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
          response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['x-ms-version-id']=self._deserialize('str', response.headers.get('x-ms-version-id'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
          response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
          response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
          response_headers['x-ms-content-crc64']=self._deserialize('bytearray', response.headers.get('x-ms-content-crc64'))
          response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      copy_from_url.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def abort_copy_from_url(  # pylint: disable=inconsistent-return-statements
          self,
          copy_id: str,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a
          destination blob with zero length and full metadata.
  
          :param copy_id: The copy identifier provided in the x-ms-copy-id header of the original Copy
           Blob operation.
          :type copy_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :keyword comp: comp. Default value is "copy". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword copy_action_abort_constant: Copy action. Default value is "abort". Note that
           overriding this default value may result in unsupported behavior.
          :paramtype copy_action_abort_constant: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "copy"))  # type: str
          copy_action_abort_constant = kwargs.pop('copy_action_abort_constant', _headers.pop('x-ms-copy-action', "abort"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _lease_id = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
  
          request = build_abort_copy_from_url_request(
              url=self._config.url,
              comp=comp,
              copy_action_abort_constant=copy_action_abort_constant,
              version=self._config.version,
              copy_id=copy_id,
              timeout=timeout,
              lease_id=_lease_id,
              request_id_parameter=request_id_parameter,
              template_url=self.abort_copy_from_url.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [204]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      abort_copy_from_url.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_tier(  # pylint: disable=inconsistent-return-statements
          self,
          tier: Union[str, "_models.AccessTierRequired"],
          snapshot: Optional[str] = None,
          version_id: Optional[str] = None,
          timeout: Optional[int] = None,
          rehydrate_priority: Optional[Union[str, "_models.RehydratePriority"]] = None,
          request_id_parameter: Optional[str] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a
          premium storage account and on a block blob in a blob storage account (locally redundant
          storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of
          the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not
          update the blob's ETag.
  
          :param tier: Indicates the tier to be set on the blob.
          :type tier: str or ~azure.storage.blob.models.AccessTierRequired
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param rehydrate_priority: Optional: Indicates the priority with which to rehydrate an archived
           blob. Default value is None.
          :type rehydrate_priority: str or ~azure.storage.blob.models.RehydratePriority
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "tier". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "tier"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _lease_id = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if modified_access_conditions is not None:
              _if_tags = modified_access_conditions.if_tags
  
          request = build_set_tier_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              tier=tier,
              snapshot=snapshot,
              version_id=version_id,
              timeout=timeout,
              rehydrate_priority=rehydrate_priority,
              request_id_parameter=request_id_parameter,
              lease_id=_lease_id,
              if_tags=_if_tags,
              template_url=self.set_tier.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 202]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          if response.status_code == 200:
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              
  
          if response.status_code == 202:
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_tier.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def get_account_info(  # pylint: disable=inconsistent-return-statements
          self,
          **kwargs: Any
      ) -> None:
          """Returns the sku name and account kind.
  
          :keyword restype: restype. Default value is "account". Note that overriding this default value
           may result in unsupported behavior.
          :paramtype restype: str
          :keyword comp: comp. Default value is "properties". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          restype = kwargs.pop('restype', _params.pop('restype', "account"))  # type: str
          comp = kwargs.pop('comp', _params.pop('comp', "properties"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          
          request = build_get_account_info_request(
              url=self._config.url,
              restype=restype,
              comp=comp,
              version=self._config.version,
              template_url=self.get_account_info.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
          response_headers['x-ms-sku-name']=self._deserialize('str', response.headers.get('x-ms-sku-name'))
          response_headers['x-ms-account-kind']=self._deserialize('str', response.headers.get('x-ms-account-kind'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      get_account_info.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def query(
          self,
          snapshot: Optional[str] = None,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          query_request: Optional[_models.QueryRequest] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          cpk_info: Optional[_models.CpkInfo] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          **kwargs: Any
      ) -> IO:
          """The Query operation enables users to select/project on blob data by providing simple query
          expressions.
  
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param query_request: the query request. Default value is None.
          :type query_request: ~azure.storage.blob.models.QueryRequest
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :param cpk_info: Parameter group. Default value is None.
          :type cpk_info: ~azure.storage.blob.models.CpkInfo
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :keyword comp: comp. Default value is "query". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IO, or the result of cls(response)
          :rtype: IO
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "query"))  # type: str
          content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/xml"))  # type: Optional[str]
          cls = kwargs.pop('cls', None)  # type: ClsType[IO]
  
          _lease_id = None
          _encryption_key = None
          _encryption_key_sha256 = None
          _encryption_algorithm = None
          _if_modified_since = None
          _if_unmodified_since = None
          _if_match = None
          _if_none_match = None
          _if_tags = None
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if cpk_info is not None:
              _encryption_key = cpk_info.encryption_key
              _encryption_key_sha256 = cpk_info.encryption_key_sha256
              _encryption_algorithm = cpk_info.encryption_algorithm
          if modified_access_conditions is not None:
              _if_modified_since = modified_access_conditions.if_modified_since
              _if_unmodified_since = modified_access_conditions.if_unmodified_since
              _if_match = modified_access_conditions.if_match
              _if_none_match = modified_access_conditions.if_none_match
              _if_tags = modified_access_conditions.if_tags
          if query_request is not None:
              _content = self._serialize.body(query_request, 'QueryRequest', is_xml=True)
          else:
              _content = None
  
          request = build_query_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              content_type=content_type,
              content=_content,
              snapshot=snapshot,
              timeout=timeout,
              lease_id=_lease_id,
              encryption_key=_encryption_key,
              encryption_key_sha256=_encryption_key_sha256,
              encryption_algorithm=_encryption_algorithm,
              if_modified_since=_if_modified_since,
              if_unmodified_since=_if_unmodified_since,
              if_match=_if_match,
              if_none_match=_if_none_match,
              if_tags=_if_tags,
              request_id_parameter=request_id_parameter,
              template_url=self.query.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=True,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 206]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          if response.status_code == 200:
              response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
              response_headers['x-ms-meta']=self._deserialize('{str}', response.headers.get('x-ms-meta'))
              response_headers['Content-Length']=self._deserialize('long', response.headers.get('Content-Length'))
              response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
              response_headers['Content-Range']=self._deserialize('str', response.headers.get('Content-Range'))
              response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
              response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
              response_headers['Content-Encoding']=self._deserialize('str', response.headers.get('Content-Encoding'))
              response_headers['Cache-Control']=self._deserialize('str', response.headers.get('Cache-Control'))
              response_headers['Content-Disposition']=self._deserialize('str', response.headers.get('Content-Disposition'))
              response_headers['Content-Language']=self._deserialize('str', response.headers.get('Content-Language'))
              response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
              response_headers['x-ms-blob-type']=self._deserialize('str', response.headers.get('x-ms-blob-type'))
              response_headers['x-ms-copy-completion-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time'))
              response_headers['x-ms-copy-status-description']=self._deserialize('str', response.headers.get('x-ms-copy-status-description'))
              response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
              response_headers['x-ms-copy-progress']=self._deserialize('str', response.headers.get('x-ms-copy-progress'))
              response_headers['x-ms-copy-source']=self._deserialize('str', response.headers.get('x-ms-copy-source'))
              response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
              response_headers['x-ms-lease-duration']=self._deserialize('str', response.headers.get('x-ms-lease-duration'))
              response_headers['x-ms-lease-state']=self._deserialize('str', response.headers.get('x-ms-lease-state'))
              response_headers['x-ms-lease-status']=self._deserialize('str', response.headers.get('x-ms-lease-status'))
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              response_headers['Accept-Ranges']=self._deserialize('str', response.headers.get('Accept-Ranges'))
              response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
              response_headers['x-ms-blob-committed-block-count']=self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count'))
              response_headers['x-ms-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-server-encrypted'))
              response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
              response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
              response_headers['x-ms-blob-content-md5']=self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5'))
              
              deserialized = response.stream_download(self._client._pipeline)
  
          if response.status_code == 206:
              response_headers['Last-Modified']=self._deserialize('rfc-1123', response.headers.get('Last-Modified'))
              response_headers['x-ms-meta']=self._deserialize('{str}', response.headers.get('x-ms-meta'))
              response_headers['Content-Length']=self._deserialize('long', response.headers.get('Content-Length'))
              response_headers['Content-Type']=self._deserialize('str', response.headers.get('Content-Type'))
              response_headers['Content-Range']=self._deserialize('str', response.headers.get('Content-Range'))
              response_headers['ETag']=self._deserialize('str', response.headers.get('ETag'))
              response_headers['Content-MD5']=self._deserialize('bytearray', response.headers.get('Content-MD5'))
              response_headers['Content-Encoding']=self._deserialize('str', response.headers.get('Content-Encoding'))
              response_headers['Cache-Control']=self._deserialize('str', response.headers.get('Cache-Control'))
              response_headers['Content-Disposition']=self._deserialize('str', response.headers.get('Content-Disposition'))
              response_headers['Content-Language']=self._deserialize('str', response.headers.get('Content-Language'))
              response_headers['x-ms-blob-sequence-number']=self._deserialize('long', response.headers.get('x-ms-blob-sequence-number'))
              response_headers['x-ms-blob-type']=self._deserialize('str', response.headers.get('x-ms-blob-type'))
              response_headers['x-ms-content-crc64']=self._deserialize('bytearray', response.headers.get('x-ms-content-crc64'))
              response_headers['x-ms-copy-completion-time']=self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time'))
              response_headers['x-ms-copy-status-description']=self._deserialize('str', response.headers.get('x-ms-copy-status-description'))
              response_headers['x-ms-copy-id']=self._deserialize('str', response.headers.get('x-ms-copy-id'))
              response_headers['x-ms-copy-progress']=self._deserialize('str', response.headers.get('x-ms-copy-progress'))
              response_headers['x-ms-copy-source']=self._deserialize('str', response.headers.get('x-ms-copy-source'))
              response_headers['x-ms-copy-status']=self._deserialize('str', response.headers.get('x-ms-copy-status'))
              response_headers['x-ms-lease-duration']=self._deserialize('str', response.headers.get('x-ms-lease-duration'))
              response_headers['x-ms-lease-state']=self._deserialize('str', response.headers.get('x-ms-lease-state'))
              response_headers['x-ms-lease-status']=self._deserialize('str', response.headers.get('x-ms-lease-status'))
              response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
              response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
              response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
              response_headers['Accept-Ranges']=self._deserialize('str', response.headers.get('Accept-Ranges'))
              response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
              response_headers['x-ms-blob-committed-block-count']=self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count'))
              response_headers['x-ms-server-encrypted']=self._deserialize('bool', response.headers.get('x-ms-server-encrypted'))
              response_headers['x-ms-encryption-key-sha256']=self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256'))
              response_headers['x-ms-encryption-scope']=self._deserialize('str', response.headers.get('x-ms-encryption-scope'))
              response_headers['x-ms-blob-content-md5']=self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5'))
              
              deserialized = response.stream_download(self._client._pipeline)
  
          if cls:
              return cls(pipeline_response, deserialized, response_headers)
  
          return deserialized
  
      query.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def get_tags(
          self,
          timeout: Optional[int] = None,
          request_id_parameter: Optional[str] = None,
          snapshot: Optional[str] = None,
          version_id: Optional[str] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          **kwargs: Any
      ) -> _models.BlobTags:
          """The Get Tags operation enables users to get the tags associated with a blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param snapshot: The snapshot parameter is an opaque DateTime value that, when present,
           specifies the blob snapshot to retrieve. For more information on working with blob snapshots,
           see :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
           a Snapshot of a Blob.</a>`. Default value is None.
          :type snapshot: str
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :keyword comp: comp. Default value is "tags". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: BlobTags, or the result of cls(response)
          :rtype: ~azure.storage.blob.models.BlobTags
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = kwargs.pop("headers", {}) or {}
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "tags"))  # type: str
          cls = kwargs.pop('cls', None)  # type: ClsType[_models.BlobTags]
  
          _if_tags = None
          _lease_id = None
          if modified_access_conditions is not None:
              _if_tags = modified_access_conditions.if_tags
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
  
          request = build_get_tags_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              timeout=timeout,
              request_id_parameter=request_id_parameter,
              snapshot=snapshot,
              version_id=version_id,
              if_tags=_if_tags,
              lease_id=_lease_id,
              template_url=self.get_tags.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
          deserialized = self._deserialize('BlobTags', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, response_headers)
  
          return deserialized
  
      get_tags.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  
      @distributed_trace_async
      async def set_tags(  # pylint: disable=inconsistent-return-statements
          self,
          timeout: Optional[int] = None,
          version_id: Optional[str] = None,
          transactional_content_md5: Optional[bytearray] = None,
          transactional_content_crc64: Optional[bytearray] = None,
          request_id_parameter: Optional[str] = None,
          tags: Optional[_models.BlobTags] = None,
          modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
          lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
          **kwargs: Any
      ) -> None:
          """The Set Tags operation enables users to set tags on a blob.
  
          :param timeout: The timeout parameter is expressed in seconds. For more information, see
           :code:`<a
           href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
           Timeouts for Blob Service Operations.</a>`. Default value is None.
          :type timeout: int
          :param version_id: The version id parameter is an opaque DateTime value that, when present,
           specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer.
           Default value is None.
          :type version_id: str
          :param transactional_content_md5: Specify the transactional md5 for the body, to be validated
           by the service. Default value is None.
          :type transactional_content_md5: bytearray
          :param transactional_content_crc64: Specify the transactional crc64 for the body, to be
           validated by the service. Default value is None.
          :type transactional_content_crc64: bytearray
          :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
           limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
           value is None.
          :type request_id_parameter: str
          :param tags: Blob tags. Default value is None.
          :type tags: ~azure.storage.blob.models.BlobTags
          :param modified_access_conditions: Parameter group. Default value is None.
          :type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
          :param lease_access_conditions: Parameter group. Default value is None.
          :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
          :keyword comp: comp. Default value is "tags". Note that overriding this default value may
           result in unsupported behavior.
          :paramtype comp: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: None, or the result of cls(response)
          :rtype: None
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}) or {})
  
          _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
          _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
  
          comp = kwargs.pop('comp', _params.pop('comp', "tags"))  # type: str
          content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/xml"))  # type: Optional[str]
          cls = kwargs.pop('cls', None)  # type: ClsType[None]
  
          _if_tags = None
          _lease_id = None
          if modified_access_conditions is not None:
              _if_tags = modified_access_conditions.if_tags
          if lease_access_conditions is not None:
              _lease_id = lease_access_conditions.lease_id
          if tags is not None:
              _content = self._serialize.body(tags, 'BlobTags', is_xml=True)
          else:
              _content = None
  
          request = build_set_tags_request(
              url=self._config.url,
              comp=comp,
              version=self._config.version,
              content_type=content_type,
              content=_content,
              timeout=timeout,
              version_id=version_id,
              transactional_content_md5=transactional_content_md5,
              transactional_content_crc64=transactional_content_crc64,
              request_id_parameter=request_id_parameter,
              if_tags=_if_tags,
              lease_id=_lease_id,
              template_url=self.set_tags.metadata['url'],
              headers=_headers,
              params=_params,
          )
          request = _convert_request(request)
          request.url = self._client.format_url(request.url)  # type: ignore
  
          pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
              request,
              stream=False,
              **kwargs
          )
          response = pipeline_response.http_response
  
          if response.status_code not in [204]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
              raise HttpResponseError(response=response, model=error)
  
          response_headers = {}
          response_headers['x-ms-client-request-id']=self._deserialize('str', response.headers.get('x-ms-client-request-id'))
          response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id'))
          response_headers['x-ms-version']=self._deserialize('str', response.headers.get('x-ms-version'))
          response_headers['Date']=self._deserialize('rfc-1123', response.headers.get('Date'))
  
  
          if cls:
              return cls(pipeline_response, None, response_headers)
  
      set_tags.metadata = {'url': "{url}/{containerName}/{blob}"}  # type: ignore
  
  