U
    #i                     @  s   d dl mZ d dlmZmZmZ d dlmZ ed ZG dd de	Z
G dd deZG d	d
 d
e
ZG dd de
ZG dd de
ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )    )annotations)ListLiteralUnion)	TypedDict)AZunexpected_failureZvalidation_failedZbad_jsonZemail_existsZphone_existsZbad_jwtZ	not_adminZno_authorizationZuser_not_foundZsession_not_foundZflow_state_not_foundZflow_state_expiredZsignup_disabledZuser_bannedZ!provider_email_needs_verificationZinvite_not_foundZbad_oauth_stateZbad_oauth_callbackZoauth_provider_not_supportedZunexpected_audienceZsingle_identity_not_deletableZ%email_conflict_identity_not_deletableZidentity_already_existsZemail_provider_disabledZphone_provider_disabledZtoo_many_enrolled_mfa_factorsZmfa_factor_name_conflictZmfa_factor_not_foundZmfa_ip_address_mismatchZmfa_challenge_expiredZmfa_verification_failedZmfa_verification_rejectedZinsufficient_aalZcaptcha_failedZsaml_provider_disabledZmanual_linking_disabledZsms_send_failedZemail_not_confirmedZphone_not_confirmedZreauth_nonce_missingZsaml_relay_state_not_foundZsaml_relay_state_expiredZsaml_idp_not_foundZsaml_assertion_no_user_idZsaml_assertion_no_emailZuser_already_existsZsso_provider_not_foundZsaml_metadata_fetch_failedZsaml_idp_already_existsZsso_domain_already_existsZsaml_entity_id_mismatchconflictZprovider_disabledZuser_sso_managedZreauthentication_neededZsame_passwordZreauthentication_not_validZotp_expiredZotp_disabledZidentity_not_foundweak_passwordZover_request_rate_limitZover_email_send_rate_limitZover_sms_send_rate_limitZbad_code_verifierc                   @  s   e Zd ZddddddZdS )	AuthErrorstr	ErrorCodeNone)messagecodereturnc                 C  s"   t | | || _d| _|| _d S )Nr	   )	Exception__init__r   namer   )selfr   r    r   1/tmp/pip-unpacked-wheel-b8wmx3ip/gotrue/errors.pyr   M   s    zAuthError.__init__N__name__
__module____qualname__r   r   r   r   r   r	   L   s   r	   c                   @  s.   e Zd ZU ded< ded< ded< ded< dS )	AuthApiErrorDictr
   r   r   intstatusr   r   Nr   r   r   __annotations__r   r   r   r   r   T   s   
r   c                   @  s.   e Zd ZdddddddZdd	d
dZdS )AuthApiErrorr
   r   r   r   )r   r   r   r   c                 C  s$   t | || d| _|| _|| _d S )Nr   )r	   r   r   r   r   )r   r   r   r   r   r   r   r   \   s    zAuthApiError.__init__r   r   c                 C  s   | j | j| j| jdS )Nr   r   r   r   r!   r   r   r   r   to_dictb   s
    zAuthApiError.to_dictNr   r   r   r   r#   r   r   r   r   r   [   s   r   c                   @  s   e Zd ZddddddZdS )AuthUnknownErrorr
   r   r   )r   original_errorr   c                 C  s   t | |d  d| _|| _d S )Nr%   )r	   r   r   r&   )r   r   r&   r   r   r   r   l   s    zAuthUnknownError.__init__Nr   r   r   r   r   r%   k   s   r%   c                   @  s0   e Zd ZddddddddZdd	d
dZdS )CustomAuthErrorr
   r   r   r   )r   r   r   r   r   c                 C  s   t | || || _|| _d S )N)r	   r   r   r   )r   r   r   r   r   r   r   r   r   s   s    zCustomAuthError.__init__r   r    c                 C  s   | j | j| jdS )Nr   r   r   r(   r"   r   r   r   r#   x   s    zCustomAuthError.to_dictNr$   r   r   r   r   r'   r   s   r'   c                   @  s   e Zd ZddddZdS )AuthSessionMissingErrorr   r    c                 C  s   t | dddd  d S )NzAuth session missing!r)     r'   r   r"   r   r   r   r      s    z AuthSessionMissingError.__init__Nr   r   r   r   r   r)      s   r)   c                   @  s   e Zd ZdddddZdS )AuthInvalidCredentialsErrorr
   r   )r   r   c                 C  s   t | |ddd  d S )Nr,   r*   r+   )r   r   r   r   r   r      s    z$AuthInvalidCredentialsError.__init__Nr   r   r   r   r   r,      s   r,   c                   @  s   e Zd ZU ded< ded< dS )%AuthImplicitGrantRedirectErrorDetailsr
   errorr   Nr   r   r   r   r   r-      s   
r-   c                   @  s   e Zd ZU ded< dS )"AuthImplicitGrantRedirectErrorDict2Union[AuthImplicitGrantRedirectErrorDetails, None]detailsNr   r   r   r   r   r/      s   
r/   c                   @  s.   e Zd ZdddddddZdd	d
dZdS )AuthImplicitGrantRedirectErrorNr
   r0   r   )r   r1   r   c                 C  s   t | |ddd  || _d S )Nr2   i  )r'   r   r1   )r   r   r1   r   r   r   r      s    z'AuthImplicitGrantRedirectError.__init__r/   r    c                 C  s   | j | j| j| jdS )Nr   r   r   r1   r3   r"   r   r   r   r#      s
    z&AuthImplicitGrantRedirectError.to_dict)Nr$   r   r   r   r   r2      s    r2   c                   @  s   e Zd ZddddddZdS )AuthRetryableErrorr
   r   r   )r   r   r   c                 C  s   t | |d|d  d S )Nr4   r+   )r   r   r   r   r   r   r      s    zAuthRetryableError.__init__Nr   r   r   r   r   r4      s   r4   c                   @  s.   e Zd ZdddddddZdd	d
dZdS )AuthWeakPasswordErrorr
   r   z	List[str]r   )r   r   reasonsr   c                 C  s   t | |d|d || _d S )Nr5   r   )r'   r   r6   )r   r   r   r6   r   r   r   r      s    zAuthWeakPasswordError.__init__r   r    c                 C  s   | j | j| j| jdS )Nr   r   r   r6   r7   r"   r   r   r   r#      s
    zAuthWeakPasswordError.to_dictNr$   r   r   r   r   r5      s   
r5   N)
__future__r   typingr   r   r   Ztyping_extensionsr   r   r   r	   r   r   r%   r'   r)   r,   r-   r/   r2   r4   r5   r   r   r   r   <module>   s"   E