a
    Qx_                     @   sN   d dl mZ d dlmZ d dlmZ G dd deZG dd deZegZdS )	    )EmailAddress)ProviderAccount)OAuth2Providerc                       s   e Zd Z fddZ  ZS )ZohoAccountc                    s   t t|  }| jjd|S )NDisplay_Name)superr   to_strZaccount
extra_dataget)selfZdflt	__class__ e/var/www/html/Ranjet/env/lib/python3.9/site-packages/allauth/socialaccount/providers/zoho/provider.pyr      s    zZohoAccount.to_str)__name__
__module____qualname__r   __classcell__r   r   r   r   r      s   r   c                   @   s8   e Zd ZdZdZeZdd Zdd Zdd Z	d	d
 Z
dS )ZohoProviderZzohoZZohoc                 C   s   dgS )Nzaaaserver.profile.READr   )r   r   r   r   get_default_scope   s    zZohoProvider.get_default_scopec                 C   s   |d S )NZZUIDr   r   datar   r   r   extract_uid   s    zZohoProvider.extract_uidc                 C   s    t |d |d |d |d dS )NEmailr   Z
First_NameZ	Last_Name)emailusernameZ
first_name	last_name)dictr   r   r   r   extract_common_fields   s    z"ZohoProvider.extract_common_fieldsc                 C   s*   g }| d}|r&|t|ddd |S )Nr   FT)r   ZverifiedZprimary)r
   appendr   )r   r   retr   r   r   r   extract_email_addresses   s    
z$ZohoProvider.extract_email_addressesN)r   r   r   idnamer   Zaccount_classr   r   r   r!   r   r   r   r   r      s   r   N)	Zallauth.account.modelsr   Z$allauth.socialaccount.providers.baser   Z/allauth.socialaccount.providers.oauth2.providerr   r   r   Zprovider_classesr   r   r   r   <module>   s
   !