def _key_response_delete(self, headers, bucket_name, query, key_name):
    self._set_action('KEY', 'DELETE', query)
    self._authenticate_and_authorize_s3_action()
    if query.get('uploadId'):
        upload_id = query['uploadId'][0]
        self.backend.abort_multipart_upload(bucket_name, upload_id)
        return (204, {}, '')
    version_id = query.get('versionId', [None])[0]
    if ('tagging' in query):
        self.backend.delete_object_tagging(bucket_name, key_name, version_id=version_id)
        template = self.response_template(S3_DELETE_KEY_TAGGING_RESPONSE)
        return (204, {}, template.render(version_id=version_id))
    bypass = headers.get('X-Amz-Bypass-Governance-Retention')
    (success, response_meta) = self.backend.delete_object(bucket_name, key_name, version_id=version_id, bypass=bypass)
    response_headers = {}
    if (response_meta is not None):
        for k in response_meta:
            response_headers['x-amz-{}'.format(k)] = response_meta[k]
    return (204, response_headers, '')
def _key_response_delete(self, headers, bucket_name, query, key_name):
    self._set_action('KEY', 'DELETE', query)
    self._authenticate_and_authorize_s3_action()
    if query.get('uploadId'):
        upload_id = query['uploadId'][0]
        self.backend.abort_multipart_upload(bucket_name, upload_id)
        return (204, {}, )
    version_id = query.get('versionId', [None])[0]
    if ('tagging' in query):
        self.backend.delete_object_tagging(bucket_name, key_name, version_id=version_id)
        template = self.response_template(S3_DELETE_KEY_TAGGING_RESPONSE)
        return (204, {}, template.render(version_id=version_id))
    bypass = headers.get('X-Amz-Bypass-Governance-Retention')
    (success, response_meta) = self.backend.delete_object(bucket_name, key_name, version_id=version_id, bypass=bypass)
    response_headers = {}
    if (response_meta is not None):
        for k in response_meta:
            response_headers['x-amz-{}'.format(k)] = response_meta[k]
    return (204, response_headers, )