o
    6d[                     @   s  d dl mZ d dlmZ d dlmZ G dd dejZeeZ	G dd dejZ
ee
ZG dd	 d	ejZeeZG d
d dejZeeZG dd dejZeeZG dd dejZeeZG dd dejZeeZG dd dejZeeZG dd dejZeeZG dd dejZeeZee_ee_e e_ ejejej de_!ede_"e e
_#e e
_$e e
_%e e
_&e e
_'ee
_(e e
_)e e
_ e
j#e
j$e
j%e
j&e
j'e
j(e
j)e
j de
_!e
de
_*e
de
_+e
de
_,e
de
_-e
de
_.e
d e
_/e
de
_"e e_0e e_1e e_ ej0ej1ej d!e_!ed"e_2ed#e_3ede_"e e_4e e_5e e_ ej4ej5ej d$e_!ed%e_6ed&e_7ede_"eej8_9e: ej;_9e<d'd(ge_=d'ej8j9fd(ej;j9fge_>e e_?e e_@e e_ ej?ej@ej d)e_!ed*e_Aed+e_Bede_"ejCd,d-ejD_9ejCd,d-ejE_9e<d.d/ge_=d.ejDj9fd/ejEj9fge_>e e_Fe e_Ge e_ ejFejGej d0e_!ed1e_Hed2e_Iede_"ejCd,d-ejJ_9e<d3ge_=d3ejJj9fge_>eC ejK_9e<d4ge_=d4ejKj9fge_>d,ej;_LeMd5d,d6eeed7d8d9d:ZNeMd;d,d6e e e d<d8d9d:ZOeNeOd=ZPd>S )?    )unicode_literals)
stone_base)stone_validatorsc                       sh   e Zd ZdZdZdZedd Zedd Zdd	 Z	d
d Z
dd Zdd Zdd Z fddZ  ZS )AccessErrora  
    Error occurred because the account doesn't have permission to access the
    resource.

    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar InvalidAccountTypeError AccessError.invalid_account_type: Current
        account type cannot access the resource.
    :ivar PaperAccessError AccessError.paper_access_denied: Current account
        cannot access Paper.
    otherNc                 C   
   | d|S )z
        Create an instance of this class set to the ``invalid_account_type`` tag
        with value ``val``.

        :param InvalidAccountTypeError val:
        :rtype: AccessError
        invalid_account_type clsvalr	   r	   cC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\dropbox/auth.pyr         
	z AccessError.invalid_account_typec                 C   r   )z
        Create an instance of this class set to the ``paper_access_denied`` tag
        with value ``val``.

        :param PaperAccessError val:
        :rtype: AccessError
        paper_access_deniedr	   r
   r	   r	   r   r   (   r   zAccessError.paper_access_deniedc                 C   
   | j dkS )z[
        Check if the union tag is ``invalid_account_type``.

        :rtype: bool
        r   Z_tagselfr	   r	   r   is_invalid_account_type3      
z#AccessError.is_invalid_account_typec                 C   r   )zZ
        Check if the union tag is ``paper_access_denied``.

        :rtype: bool
        r   r   r   r	   r	   r   is_paper_access_denied;   r   z"AccessError.is_paper_access_deniedc                 C   r   zL
        Check if the union tag is ``other``.

        :rtype: bool
        r   r   r   r	   r	   r   is_otherC   r   zAccessError.is_otherc                 C      |   std| jS )z
        Current account type cannot access the resource.

        Only call this if :meth:`is_invalid_account_type` is true.

        :rtype: InvalidAccountTypeError
        z"tag 'invalid_account_type' not set)r   AttributeError_valuer   r	   r	   r   get_invalid_account_typeK      z$AccessError.get_invalid_account_typec                 C   r   )z
        Current account cannot access Paper.

        Only call this if :meth:`is_paper_access_denied` is true.

        :rtype: PaperAccessError
        z!tag 'paper_access_denied' not set)r   r   r   r   r	   r	   r   get_paper_access_deniedW   r   z#AccessError.get_paper_access_deniedc                       t t| ||| d S N)superr   _process_custom_annotationsr   Zannotation_typeZ
field_path	processor	__class__r	   r   r"   c      z'AccessError._process_custom_annotations)__name__
__module____qualname____doc__
_catch_allr   classmethodr   r   r   r   r   r   r   r"   __classcell__r	   r	   r%   r   r   
   s    



r   c                       s   e Zd ZdZdZdZdZdZdZdZ	dZ
dZedd Zdd Zdd	 Zd
d Zdd Zdd Zdd Zdd Zdd Zdd Z fddZ  ZS )	AuthErrora  
    Errors occurred during authentication.

    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar auth.AuthError.invalid_access_token: The access token is invalid.
    :ivar auth.AuthError.invalid_select_user: The user specified in
        'Dropbox-API-Select-User' is no longer on the team.
    :ivar auth.AuthError.invalid_select_admin: The user specified in
        'Dropbox-API-Select-Admin' is not a Dropbox Business team admin.
    :ivar auth.AuthError.user_suspended: The user has been suspended.
    :ivar auth.AuthError.expired_access_token: The access token has expired.
    :ivar TokenScopeError AuthError.missing_scope: The access token does not
        have the required scope to access the route.
    :ivar auth.AuthError.route_access_denied: The route is not available to
        public.
    r   Nc                 C   r   )z
        Create an instance of this class set to the ``missing_scope`` tag with
        value ``val``.

        :param TokenScopeError val:
        :rtype: AuthError
        missing_scoper	   r
   r	   r	   r   r0      r   zAuthError.missing_scopec                 C   r   )z[
        Check if the union tag is ``invalid_access_token``.

        :rtype: bool
        invalid_access_tokenr   r   r	   r	   r   is_invalid_access_token   r   z!AuthError.is_invalid_access_tokenc                 C   r   )zZ
        Check if the union tag is ``invalid_select_user``.

        :rtype: bool
        invalid_select_userr   r   r	   r	   r   is_invalid_select_user   r   z AuthError.is_invalid_select_userc                 C   r   )z[
        Check if the union tag is ``invalid_select_admin``.

        :rtype: bool
        invalid_select_adminr   r   r	   r	   r   is_invalid_select_admin   r   z!AuthError.is_invalid_select_adminc                 C   r   )zU
        Check if the union tag is ``user_suspended``.

        :rtype: bool
        user_suspendedr   r   r	   r	   r   is_user_suspended   r   zAuthError.is_user_suspendedc                 C   r   )z[
        Check if the union tag is ``expired_access_token``.

        :rtype: bool
        expired_access_tokenr   r   r	   r	   r   is_expired_access_token   r   z!AuthError.is_expired_access_tokenc                 C   r   )zT
        Check if the union tag is ``missing_scope``.

        :rtype: bool
        r0   r   r   r	   r	   r   is_missing_scope   r   zAuthError.is_missing_scopec                 C   r   )zZ
        Check if the union tag is ``route_access_denied``.

        :rtype: bool
        route_access_deniedr   r   r	   r	   r   is_route_access_denied   r   z AuthError.is_route_access_deniedc                 C   r   r   r   r   r	   r	   r   r      r   zAuthError.is_otherc                 C   r   )z
        The access token does not have the required scope to access the route.

        Only call this if :meth:`is_missing_scope` is true.

        :rtype: TokenScopeError
        ztag 'missing_scope' not set)r;   r   r   r   r	   r	   r   get_missing_scope   r   zAuthError.get_missing_scopec                    r   r    )r!   r/   r"   r#   r%   r	   r   r"      r'   z%AuthError._process_custom_annotations)r(   r)   r*   r+   r,   r1   r3   r5   r7   r9   r<   r   r-   r0   r2   r4   r6   r8   r:   r;   r=   r   r>   r"   r.   r	   r	   r%   r   r/   h   s,    

r/   c                       H   e Zd ZdZdZdZdZdZdd Zdd Z	dd	 Z
 fd
dZ  ZS )InvalidAccountTypeErrora  
    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar auth.InvalidAccountTypeError.endpoint: Current account type doesn't
        have permission to access this route endpoint.
    :ivar auth.InvalidAccountTypeError.feature: Current account type doesn't
        have permission to access this feature.
    r   Nc                 C   r   )zO
        Check if the union tag is ``endpoint``.

        :rtype: bool
        endpointr   r   r	   r	   r   is_endpoint   r   z#InvalidAccountTypeError.is_endpointc                 C   r   )zN
        Check if the union tag is ``feature``.

        :rtype: bool
        featurer   r   r	   r	   r   
is_feature  r   z"InvalidAccountTypeError.is_featurec                 C   r   r   r   r   r	   r	   r   r     r   z InvalidAccountTypeError.is_otherc                    r   r    )r!   r@   r"   r#   r%   r	   r   r"     r'   z3InvalidAccountTypeError._process_custom_annotations)r(   r)   r*   r+   r,   rA   rC   r   rB   rD   r   r"   r.   r	   r	   r%   r   r@          r@   c                       r?   )PaperAccessErrorak  
    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar auth.PaperAccessError.paper_disabled: Paper is disabled.
    :ivar auth.PaperAccessError.not_paper_user: The provided user has not used
        Paper yet.
    r   Nc                 C   r   )zU
        Check if the union tag is ``paper_disabled``.

        :rtype: bool
        paper_disabledr   r   r	   r	   r   is_paper_disabled-  r   z"PaperAccessError.is_paper_disabledc                 C   r   )zU
        Check if the union tag is ``not_paper_user``.

        :rtype: bool
        not_paper_userr   r   r	   r	   r   is_not_paper_user5  r   z"PaperAccessError.is_not_paper_userc                 C   r   r   r   r   r	   r	   r   r   =  r   zPaperAccessError.is_otherc                    r   r    )r!   rF   r"   r#   r%   r	   r   r"   E  r'   z,PaperAccessError._process_custom_annotations)r(   r)   r*   r+   r,   rG   rI   r   rH   rJ   r   r"   r.   r	   r	   r%   r   rF     s    
rF   c                       sR   e Zd ZdZddgZdZ		dddZejddd	Z	ed
Z
 fddZ  ZS )RateLimitErrora  
    Error occurred because the app is being rate limited.

    :ivar auth.RateLimitError.reason: The reason why the app is being rate
        limited.
    :ivar auth.RateLimitError.retry_after: The number of seconds that the app
        should wait before making another request.
    _reason_value_retry_after_valueTNc                 C   4   t j| _t j| _|d ur|| _|d ur|| _d S d S r    )bbNOT_SETrL   rM   reasonretry_after)r   rQ   rR   r	   r	   r   __init__[     
zRateLimitError.__init__rQ   )Zuser_definedrR   c                    r   r    )r!   rK   r"   r#   r%   r	   r   r"   k  r'   z*RateLimitError._process_custom_annotationsNN)r(   r)   r*   r+   	__slots___has_required_fieldsrS   rO   	AttributerQ   rR   r"   r.   r	   r	   r%   r   rK   J  s    


rK   c                       r?   )RateLimitReasona  
    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar auth.RateLimitReason.too_many_requests: You are making too many
        requests in the past few minutes.
    :ivar auth.RateLimitReason.too_many_write_operations: There are currently
        too many write operations happening in the user's Dropbox.
    r   Nc                 C   r   )zX
        Check if the union tag is ``too_many_requests``.

        :rtype: bool
        too_many_requestsr   r   r	   r	   r   is_too_many_requests  r   z$RateLimitReason.is_too_many_requestsc                 C   r   )z`
        Check if the union tag is ``too_many_write_operations``.

        :rtype: bool
        too_many_write_operationsr   r   r	   r	   r   is_too_many_write_operations  r   z,RateLimitReason.is_too_many_write_operationsc                 C   r   r   r   r   r	   r	   r   r     r   zRateLimitReason.is_otherc                    r   r    )r!   rY   r"   r#   r%   r	   r   r"     r'   z+RateLimitReason._process_custom_annotations)r(   r)   r*   r+   r,   rZ   r\   r   r[   r]   r   r"   r.   r	   r	   r%   r   rY   p  rE   rY   c                       sN   e Zd ZdZddgZdZ		dddZedZ	ed	Z
 fd
dZ  ZS )TokenFromOAuth1Argz
    :ivar auth.TokenFromOAuth1Arg.oauth1_token: The supplied OAuth 1.0 access
        token.
    :ivar auth.TokenFromOAuth1Arg.oauth1_token_secret: The token secret
        associated with the supplied access token.
    _oauth1_token_value_oauth1_token_secret_valueTNc                 C   rN   r    )rO   rP   r_   r`   oauth1_tokenoauth1_token_secret)r   ra   rb   r	   r	   r   rS     rT   zTokenFromOAuth1Arg.__init__ra   rb   c                    r   r    )r!   r^   r"   r#   r%   r	   r   r"     r'   z.TokenFromOAuth1Arg._process_custom_annotationsrU   )r(   r)   r*   r+   rV   rW   rS   rO   rX   ra   rb   r"   r.   r	   r	   r%   r   r^     s    


r^   c                       r?   )TokenFromOAuth1Errora  
    This class acts as a tagged union. Only one of the ``is_*`` methods will
    return true. To get the associated value of a tag (if one exists), use the
    corresponding ``get_*`` method.

    :ivar auth.TokenFromOAuth1Error.invalid_oauth1_token_info: Part or all of
        the OAuth 1.0 access token info is invalid.
    :ivar auth.TokenFromOAuth1Error.app_id_mismatch: The authorized app does not
        match the app associated with the supplied access token.
    r   Nc                 C   r   )z`
        Check if the union tag is ``invalid_oauth1_token_info``.

        :rtype: bool
        invalid_oauth1_token_infor   r   r	   r	   r   is_invalid_oauth1_token_info  r   z1TokenFromOAuth1Error.is_invalid_oauth1_token_infoc                 C   r   )zV
        Check if the union tag is ``app_id_mismatch``.

        :rtype: bool
        app_id_mismatchr   r   r	   r	   r   is_app_id_mismatch  r   z'TokenFromOAuth1Error.is_app_id_mismatchc                 C   r   r   r   r   r	   r	   r   r     r   zTokenFromOAuth1Error.is_otherc                    r   r    )r!   rc   r"   r#   r%   r	   r   r"     r'   z0TokenFromOAuth1Error._process_custom_annotations)r(   r)   r*   r+   r,   rd   rf   r   re   rg   r   r"   r.   r	   r	   r%   r   rc     rE   rc   c                       @   e Zd ZdZdgZdZ	d
ddZedZ	 fdd	Z
  ZS )TokenFromOAuth1Resultz
    :ivar auth.TokenFromOAuth1Result.oauth2_token: The OAuth 2.0 token generated
        from the supplied OAuth 1.0 token.
    _oauth2_token_valueTNc                 C      t j| _|d ur|| _d S d S r    )rO   rP   rj   oauth2_token)r   rl   r	   r	   r   rS        
zTokenFromOAuth1Result.__init__rl   c                    r   r    )r!   ri   r"   r#   r%   r	   r   r"     r'   z1TokenFromOAuth1Result._process_custom_annotationsr    )r(   r)   r*   r+   rV   rW   rS   rO   rX   rl   r"   r.   r	   r	   r%   r   ri         

ri   c                       rh   )TokenScopeErrorzd
    :ivar auth.TokenScopeError.required_scope: The required scope to access the
        route.
    _required_scope_valueTNc                 C   rk   r    )rO   rP   rp   required_scope)r   rq   r	   r	   r   rS     rm   zTokenScopeError.__init__rq   c                    r   r    )r!   ro   r"   r#   r%   r	   r   r"   %  r'   z+TokenScopeError._process_custom_annotationsr    )r(   r)   r*   r+   rV   rW   rS   rO   rX   rq   r"   r.   r	   r	   r%   r   ro     rn   ro   )r   r   r   r   )r1   r3   r5   r7   r9   r0   r<   r   r1   r3   r5   r7   r9   r<   )rA   rC   r   rA   rC   )rG   rI   r   rG   rI   rQ   rR   )rZ   r\   r   rZ   r\      )Z
min_lengthra   rb   )rd   rf   r   rd   rf   rl   rq   token/from_oauth1FZappapiZrpc)authhoststyletoken/revokeuser)rs   rx   N)Q
__future__r   Zstone.backends.python_rsrcr   rO   r   ZbvUnionr   ZAccessError_validatorr/   ZAuthError_validatorr@   Z!InvalidAccountTypeError_validatorrF   ZPaperAccessError_validatorStructrK   ZRateLimitError_validatorrY   ZRateLimitReason_validatorr^   ZTokenFromOAuth1Arg_validatorrc   ZTokenFromOAuth1Error_validatorri   ZTokenFromOAuth1Result_validatorro   ZTokenScopeError_validatorZ_invalid_account_type_validatorZ_paper_access_denied_validatorZVoidZ_other_validatorZ_tagmapr   Z_invalid_access_token_validatorZ_invalid_select_user_validatorZ_invalid_select_admin_validatorZ_user_suspended_validatorZ_expired_access_token_validatorZ_missing_scope_validatorZ_route_access_denied_validatorr1   r3   r5   r7   r9   r<   Z_endpoint_validatorZ_feature_validatorrA   rC   Z_paper_disabled_validatorZ_not_paper_user_validatorrG   rI   rQ   	validatorZUInt64rR   setZ_all_field_names_Z_all_fields_Z_too_many_requests_validatorZ$_too_many_write_operations_validatorrZ   r\   Stringra   rb   Z$_invalid_oauth1_token_info_validatorZ_app_id_mismatch_validatorrd   rf   rl   rq   defaultZRouteZtoken_from_oauth1Ztoken_revokeZROUTESr	   r	   r	   r   <module>   s&  
\

/
.
$
/
"
/














































