o
    ߭h                     @   s`  d dl mZmZmZmZ d dlmZmZmZ d dl	m
Z d dlmZ edZededZerJded	eeef fd
dZdee ded	efddZnded	eeef fddZdee ded	efddZG dd deZG dd deeej ZG dd deZG dd deZededZededZededZG dd deeej ZG dd  d eZd!S )"    )AnyGenericOptionalTypeVar)	BaseModel
ConfigDictEmailStr)VERSION)modelsz2.SCHEMA)boundmodelreturnc                 O      | j |i |S N
model_dumpr   argskwargs r   Z/var/www/html/stock_analysis/be/venv/lib/python3.10/site-packages/fastapi_users/schemas.pyr         r   schemaobjc                 O   s   | j |g|R i |S r   )model_validater   r   r   r   r   r   r   r      s   r   c                 O   r   r   )dictr   r   r   r   r      r   c                 O   s
   |  |S r   )from_ormr   r   r   r   r      s   
c                   @   s   e Zd Zdd Zdd ZdS )CreateUpdateDictModelc                 C   s   t | dh ddS )NT>   id	is_activeis_verifiedis_superuseroauth_accountsexclude_unsetexcluder   selfr   r   r   create_update_dict   s
   z(CreateUpdateDictModel.create_update_dictc                 C   s   t | ddhdS )NTr    r%   r   r(   r   r   r   create_update_dict_superuser+   r   z2CreateUpdateDictModel.create_update_dict_superuserN)__name__
__module____qualname__r*   r+   r   r   r   r   r      s    r   c                   @   sh   e Zd ZU dZejed< eed< dZe	ed< dZ
e	ed< dZe	ed< er+edd	ZdS G d
d dZdS )BaseUserzBase User model.r    emailTr!   Fr#   r"   from_attributesc                   @      e Zd ZdZdS )zBaseUser.ConfigTNr,   r-   r.   orm_moder   r   r   r   Config<       r6   N)r,   r-   r.   __doc__r
   ID__annotations__r   r!   boolr#   r"   PYDANTIC_V2r   model_configr6   r   r   r   r   r/   /   s   
 
r/   c                   @   sN   e Zd ZU eed< eed< dZee ed< dZ	ee ed< dZ
ee ed< dS )	BaseUserCreater0   passwordTr!   Fr#   r"   N)r,   r-   r.   r   r:   strr!   r   r;   r#   r"   r   r   r   r   r>   @   s   
 r>   c                   @   s^   e Zd ZU dZee ed< dZee ed< dZ	ee
 ed< dZee
 ed< dZee
 ed< dS )BaseUserUpdateNr?   r0   r!   r#   r"   )r,   r-   r.   r?   r   r@   r:   r0   r   r!   r;   r#   r"   r   r   r   r   rA   H   s   
 rA   UUCUUc                   @   s|   e Zd ZU dZejed< eed< eed< dZe	e
 ed< dZe	e ed< eed< eed	< er5ed
dZdS G dd dZdS )BaseOAuthAccountzBase OAuth account model.r    
oauth_nameaccess_tokenN
expires_atrefresh_token
account_idaccount_emailTr1   c                   @   r3   )zBaseOAuthAccount.ConfigTNr4   r   r   r   r   r6   d   r7   r6   )r,   r-   r.   r8   r
   r9   r:   r@   rH   r   intrI   r<   r   r=   r6   r   r   r   r   rE   U   s   
 
rE   c                   @   s"   e Zd ZU dZg Zee ed< dS )BaseOAuthAccountMixinz)Adds OAuth accounts list to a User model.r$   N)r,   r-   r.   r8   r$   listrE   r:   r   r   r   r   rM   h   s   
 rM   N) typingr   r   r   r   pydanticr   r   r   pydantic.versionr	   PYDANTIC_VERSIONfastapi_usersr
   
startswithr<   r   r   r@   r   typer   r   r9   r/   r>   rA   rB   rC   rD   rE   rM   r   r   r   r   <module>   s(    
