'validate this idp instance'

def validate(self):

    if (not isinstance(self.provider['attributes'], dict)):
        raise errors.AnsibleFilterError('|failed    attributes    for    provider    {0}    must    be    a    dictionary'.format(self.__class__.__name__))
    attrs = ['id', 'email', 'name', 'preferredUsername']
    for attr in attrs:
        if ((attr in self.provider['attributes']) and (not isinstance(self.provider['attributes'][attr], list))):
            raise errors.AnsibleFilterError('|failed    {0}    attribute    for    provider    {1}    must    be    a    list'.format(attr, self.__class__.__name__))
    unknown_attrs = (set(self.provider['attributes'].keys()) - set(attrs))
    if (len(unknown_attrs) > 0):
        raise errors.AnsibleFilterError('|failed    provider    {0}    has    unknown    attributes:    {1}'.format(self.__class__.__name__, ',    '.join(unknown_attrs)))
