Delete all objects in a given S3 bucket.

    Returns {deleted: true} if all objects were deleted
    and {deleted: false, failed: [key, ...]} otherwise

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.empty mybucket

def empty(Bucket, MFA=None, RequestPayer=None, region=None, key=None,
          keyid=None, profile=None):
    '''
    Delete all objects in a given S3 bucket.

    Returns {deleted: true} if all objects were deleted
    and {deleted: false, failed: [key, ...]} otherwise

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.empty mybucket

    '''

    stuff = list_object_versions(Bucket, region=region, key=key, keyid=keyid,
                                 profile=profile)
    Delete = {}
    Delete['Objects'] = [{'Key': v['Key'], 'VersionId': v['VersionId']} for v in stuff.get('Versions', [])]
    Delete['Objects'] += [{'Key': v['Key'], 'VersionId': v['VersionId']} for v in stuff.get('DeleteMarkers', [])]
    if Delete['Objects']:
        ret = delete_objects(Bucket, Delete, MFA=MFA, RequestPayer=RequestPayer,
                             region=region, key=key, keyid=keyid, profile=profile)
        failed = ret.get('failed', [])
        if failed:
            return {'deleted': False, 'failed': ret[failed]}
    return {'deleted': True}