@classmethod
def allowed_is_valid(cls, allowed):
    """
        Make sure that all of the required fields are present, and that
        bucketId is set if bucketName is.

        If the bucketId is for a bucket that no longer exists, or the
        capabilities do not allow for listBuckets, then we will not have a bucketName.

        :param dict allowed: the structure to use for old account info that was saved without 'allowed'
        :rtype: bool
        """
    return 'bucketId' in allowed and 'bucketName' in allowed and (allowed[
        'bucketId'] is not None or allowed['bucketName'] is None
        ) and 'capabilities' in allowed and 'namePrefix' in allowed
