'Check of credentials (no API call)
Valid combinations of v3 credentials (excluding token)
- User id, password (optional domain)
- User name, password and its domain id/name
For the scope, valid combinations are:
- None
- Project id (optional domain)
- Project name and its domain id/name
- Domain id
- Domain name'

def is_valid(self):

    valid_user_domain = any([(self.user_domain_id is not None), (self.user_domain_name is not None)])
    valid_project_domain = any([(self.project_domain_id is not None), (self.project_domain_name is not None)])
    valid_user = any([(self.user_id is not None), ((self.username is not None) and valid_user_domain)])
    valid_project_scope = any([((self.project_name is None) and (self.project_id is None)), (self.project_id is not None), ((self.project_name is not None) and valid_project_domain)])
    valid_domain_scope = any([((self.domain_id is None) and (self.domain_name is None)), (self.domain_id or self.domain_name)])
    return all([(self.password is not None), valid_user, (valid_project_scope and valid_domain_scope)])
