'validate this idp instance'

def validate(self):

    IdentityProviderOauthBase.validate(self)
    if (not isinstance(self.provider['claims'], dict)):
        raise errors.AnsibleFilterError('|failed    claims    for    provider    {0}    must    be    a    dictionary'.format(self.__class__.__name__))
    for (var, var_type) in (('extraScopes', list), ('extraAuthorizeParameters', dict)):
        if ((var in self.provider) and (not isinstance(self.provider[var], var_type))):
            raise errors.AnsibleFilterError('|failed    {1}    for    provider    {0}    must    be    a    {2}'.format(self.__class__.__name__, var, var_type.__class__.__name__))
    required_claims = ['id']
    optional_claims = ['email', 'name', 'preferredUsername']
    all_claims = (required_claims + optional_claims)
    for claim in required_claims:
        if ((claim in required_claims) and (claim not in self.provider['claims'])):
            raise errors.AnsibleFilterError('|failed    {0}    claim    missing    for    provider    {1}'.format(claim, self.__class__.__name__))
    for claim in all_claims:
        if ((claim in self.provider['claims']) and (not isinstance(self.provider['claims'][claim], list))):
            raise errors.AnsibleFilterError('|failed    {0}    claims    for    provider    {1}    must    be    a    list'.format(claim, self.__class__.__name__))
    unknown_claims = (set(self.provider['claims'].keys()) - set(all_claims))
    if (len(unknown_claims) > 0):
        raise errors.AnsibleFilterError('|failed    provider    {0}    has    unknown    claims:    {1}'.format(self.__class__.__name__, ',    '.join(unknown_claims)))
    if (not isinstance(self.provider['urls'], dict)):
        raise errors.AnsibleFilterError('|failed    urls    for    provider    {0}    must    be    a    dictionary'.format(self.__class__.__name__))
    required_urls = ['authorize', 'token']
    optional_urls = ['userInfo']
    all_urls = (required_urls + optional_urls)
    for url in required_urls:
        if (url not in self.provider['urls']):
            raise errors.AnsibleFilterError('|failed    {0}    url    missing    for    provider    {1}'.format(url, self.__class__.__name__))
    unknown_urls = (set(self.provider['urls'].keys()) - set(all_urls))
    if (len(unknown_urls) > 0):
        raise errors.AnsibleFilterError('|failed    provider    {0}    has    unknown    urls:    {1}'.format(self.__class__.__name__, ',    '.join(unknown_urls)))
